Well, I ended up with these convoluted (and nonfunctional) alternatives after the most obvious attempts didn't work.
Here's attempt 1:
Code:
transform(str_de.begin(), str_de.end(),str_de.begin(), ct_de.tolower());
which gave me this error message:
Code:
final_align.cpp: In function ‚:
final_align.cpp:77: error: no matching function for call to ‚
/usr/lib/gcc/i486-linux-gnu/4.0.3/../../../../include/c++/4.0.3/bits/locale_facets.h:829: note: candidates are: char std::ctype<char>::tolower(char) const
/usr/lib/gcc/i486-linux-gnu/4.0.3/../../../../include/c++/4.0.3/bits/locale_facets.h:846: note: const char* std::ctype<char>::tolower(char*, const char*) const
Then I tried:
Code:
transform(str_de.begin(), str_de.end(),str_de.begin(), bind2nd(tolower(), loc_de));
which gave me
Code:
final_align.cpp: In function ‚:
/usr/include/ctype.h:116: error: too few arguments to function ‚
final_align.cpp:77: error: at this point in file
final_align.cpp:19: warning: unused variable ‚
Then I tried
Code:
transform(str_de.begin(), str_de.end(),str_de.begin(), use_facet<ctype<char> >(loc_de).tolower());
which gave me
Code:
/usr/bin/g++ -Wall -DCULL final_align.cpp -o final_align
final_align.cpp: In function ‚:
/usr/include/ctype.h:116: error: too few arguments to function ‚
final_align.cpp:77: error: at this point in file
final_align.cpp:19: warning: unused variable ‚
make: *** [cull] Error 1
tsmoon@odyssey:~/BACKUPEXCLUDE/lex_ac/Data/final$ make -k cull
/usr/bin/g++ -Wall -DCULL final_align.cpp -o final_align
final_align.cpp: In function ‚:
final_align.cpp:77: error: no matching function for call to ‚
/usr/lib/gcc/i486-linux-gnu/4.0.3/../../../../include/c++/4.0.3/bits/locale_facets.h:829: note: candidates are: char std::ctype<char>::tolower(char) const
/usr/lib/gcc/i486-linux-gnu/4.0.3/../../../../include/c++/4.0.3/bits/locale_facets.h:846: note: const char* std::ctype<char>::tolower(char*, const char*) const
final_align.cpp:77: error: expected `;' before ‚ token
final_align.cpp:19: warning: unused variable ‚
make: *** [cull] Error 1
So my solutions got more and more complicated to the version you are looking at now.
Anyway, I'll try your class based approach.