Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #7685 > unrolled thread

not match function for call to transform

Started byeric <cneric12lin0@gmail.com>
First post2011-07-09 14:52 -0700
Last post2011-07-10 10:55 +1200
Articles 2 — 2 participants

Back to article view | Back to comp.lang.c++


Contents

  not match function for call to transform eric <cneric12lin0@gmail.com> - 2011-07-09 14:52 -0700
    Re: not match function for call to transform Ian Collins <ian-news@hotmail.com> - 2011-07-10 10:55 +1200

#7685 — not match function for call to transform

Fromeric <cneric12lin0@gmail.com>
Date2011-07-09 14:52 -0700
Subjectnot match function for call to transform
Message-ID<61a46c4b-2b8b-4147-92ab-b41828e14220@y13g2000prb.googlegroups.com>
Dear advanced c++ programers:

  I tried 4.14 Doing a Case-Insensitive String Search from book C++
cookbook on page 173, example 4-22
on my g++ 4.5.2 system
but I got compile error
----------------------------------
eric@eric-laptop:~/cppcookbook/ch4$ g++ Example4-22.cpp
Example4-22.cpp: In function ‘std::basic_string<char>::const_iterator
caseInsFind(std::string&, const std::string&)’:
Example4-22.cpp:19:20: error: no matching function for call to
‘transform(std::basic_string<char>::const_iterator,
std::basic_string<char>::const_iterator,
std::back_insert_iterator<std::basic_string<char> >, <unresolved
overloaded function type>)’
-------------------------------------
example source code can get from here
http://examples.oreilly.com/9780596007614/

plz help and thanks a lot in advance, Eric

[toc] | [next] | [standalone]


#7686

FromIan Collins <ian-news@hotmail.com>
Date2011-07-10 10:55 +1200
Message-ID<97s4k7F6tmU4@mid.individual.net>
In reply to#7685
On 07/10/11 09:52 AM, eric wrote:
> Dear advanced c++ programers:
>
>    I tried 4.14 Doing a Case-Insensitive String Search from book C++
> cookbook on page 173, example 4-22
> on my g++ 4.5.2 system
> but I got compile error
> ----------------------------------
> eric@eric-laptop:~/cppcookbook/ch4$ g++ Example4-22.cpp
> Example4-22.cpp: In function ‘std::basic_string<char>::const_iterator
> caseInsFind(std::string&, const std::string&)’:
> Example4-22.cpp:19:20: error: no matching function for call to
> ‘transform(std::basic_string<char>::const_iterator,
> std::basic_string<char>::const_iterator,
> std::back_insert_iterator<std::basic_string<char>  >,<unresolved
> overloaded function type>)’
> -------------------------------------
> example source code can get from here
> http://examples.oreilly.com/9780596007614/

g++ is picking the wrong toupper, try ::toupper.

-- 
Ian Collins

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.c++


csiph-web