T
Taras_96
Hi everyone,
I found the following piece of code on the net and just wanted to
check whether I understood it correctly:
std::transform( s.begin(), s.end(), s.begin(),
std::bind1st( std::mem_fun( &std::ctype<char>::tolower ),
&std::use_facet< std::ctype<char> >( loc ) ) );
ctype<char>: is this implying that ctype is a templated class?
so std::ctype<char>::tolower translates to:
the tolower member function of the ctype<char> class in the std name
space?
also:
std::use_facet< std::ctype<char> >( loc )
it seems that the type of the return argument for use_facet has been
explicitly specified by <std::ctype<char> > - is this correct? Again,
is std::ctype<char> referencing a char instance of the ctype templated
class?
It seems that this is correct when the definition of the use_facet
function is inspected:
template <class Facet>
Facet const& use_facet(locale const& loc);
Thanks
Taras
I found the following piece of code on the net and just wanted to
check whether I understood it correctly:
std::transform( s.begin(), s.end(), s.begin(),
std::bind1st( std::mem_fun( &std::ctype<char>::tolower ),
&std::use_facet< std::ctype<char> >( loc ) ) );
ctype<char>: is this implying that ctype is a templated class?
so std::ctype<char>::tolower translates to:
the tolower member function of the ctype<char> class in the std name
space?
also:
std::use_facet< std::ctype<char> >( loc )
it seems that the type of the return argument for use_facet has been
explicitly specified by <std::ctype<char> > - is this correct? Again,
is std::ctype<char> referencing a char instance of the ctype templated
class?
It seems that this is correct when the definition of the use_facet
function is inspected:
template <class Facet>
Facet const& use_facet(locale const& loc);
Thanks
Taras