함수 템플릿 질문 : 솔루션의C++ 나는 C의 ++의 STL 클래스 UCASE/LCASE하는 가장 좋은 방법을 찾고 있었고, 난이 게시물 건너 온
한 부여했다 :
#include <algorithm>
#include <string>
std::string data = “Abc”;
std::transform(data.begin(), data.end(), data.begin(), ::tolower);
그러나, stl_algo.h에 정의 된 변환 :
template<typename _InputIterator, typename _OutputIterator,
typename _UnaryOperation>
_OutputIterator
transform(_InputIterator __first, _InputIterator __last,
_OutputIterator __result, _UnaryOperation __unary_op)
{
...
어떻게 닷컴 인스턴스 템플릿 매개 변수를 제공하지 않고 호출되고 있습니까?
transform(std::string::iterator, std::string::iterator,
/* not sure what to put here for the predicate */);
이 한 오프 (특별한 경우)인가, 아니면 근본적인 뭔가를 놓친 거지 :
내 질문에 명확히하기 위해
, 나는 변환 함수를 기다리고 있었다처럼 호출 할?