B
benben
I wrote the following lines:
#include <locale>
#include <functional>
#include <algorithm>
int main()
{
using namespace std;
bind2nd(ptr_fun(tolower<char>), locale());
}
and I got the following errors
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"plotter.d"
-MT"plotter.d" -o"plotter.o" "../plotter.cpp"
/usr/include/c++/4.1.3/bits/stl_function.h: In instantiation of
‘std::binder2nd<std:ointer_to_binary_function<char, const
std::locale&, char> >’:
.../plotter.cpp:14: instantiated from here
/usr/include/c++/4.1.3/bits/stl_function.h:435: error: forming reference
to reference type ‘const std::locale&’
/usr/include/c++/4.1.3/bits/stl_function.h: In function
‘std::binder2nd<_Operation> std::bind2nd(const _Operation&, const _Tp&)
[with _Operation = std:ointer_to_binary_function<char, const
std::locale&, char>, _Tp = std::locale]’:
.../plotter.cpp:14: instantiated from here
/usr/include/c++/4.1.3/bits/stl_function.h:455: error: no matching
function for call to
‘std::binder2nd<std:ointer_to_binary_function<char, const
std::locale&, char> >::binder2nd(const
std:ointer_to_binary_function<char, const std::locale&, char>&, const
std::locale&)’
/usr/include/c++/4.1.3/bits/stl_function.h:429: note: candidates are:
std::binder2nd<std:ointer_to_binary_function<char, const std::locale&,
char> >::binder2nd(const
std::binder2nd<std:ointer_to_binary_function<char, const std::locale&,
char> >&)
Sorry but I've tried my best to understand the error message. I have no
idea why
"forming reference to reference type 'const std::locale&'"
is an error. Or is the error elsewhere?
Regards,
Ben
#include <locale>
#include <functional>
#include <algorithm>
int main()
{
using namespace std;
bind2nd(ptr_fun(tolower<char>), locale());
}
and I got the following errors
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"plotter.d"
-MT"plotter.d" -o"plotter.o" "../plotter.cpp"
/usr/include/c++/4.1.3/bits/stl_function.h: In instantiation of
‘std::binder2nd<std:ointer_to_binary_function<char, const
std::locale&, char> >’:
.../plotter.cpp:14: instantiated from here
/usr/include/c++/4.1.3/bits/stl_function.h:435: error: forming reference
to reference type ‘const std::locale&’
/usr/include/c++/4.1.3/bits/stl_function.h: In function
‘std::binder2nd<_Operation> std::bind2nd(const _Operation&, const _Tp&)
[with _Operation = std:ointer_to_binary_function<char, const
std::locale&, char>, _Tp = std::locale]’:
.../plotter.cpp:14: instantiated from here
/usr/include/c++/4.1.3/bits/stl_function.h:455: error: no matching
function for call to
‘std::binder2nd<std:ointer_to_binary_function<char, const
std::locale&, char> >::binder2nd(const
std:ointer_to_binary_function<char, const std::locale&, char>&, const
std::locale&)’
/usr/include/c++/4.1.3/bits/stl_function.h:429: note: candidates are:
std::binder2nd<std:ointer_to_binary_function<char, const std::locale&,
char> >::binder2nd(const
std::binder2nd<std:ointer_to_binary_function<char, const std::locale&,
char> >&)
Sorry but I've tried my best to understand the error message. I have no
idea why
"forming reference to reference type 'const std::locale&'"
is an error. Or is the error elsewhere?
Regards,
Ben