[C++-sig] Re: Getting the pointer for a member operator

David Abrahams dave at boost-consulting.com
Wed Apr 27 20:51:53 CEST 2005


Nicodemus <nicodemus at esss.com.br> writes:

> Problem is that this is broken under MSVC.NET 2003. The compiler 
> complains with:
>
> """
> _operators.cpp(24) : error C2833: 'operator const' is not a recognized 
> operator or type
> """
>
> ie, the compiler doesn't realize that its the operator const char* that 
> it should get the address to. I tried changing it to:
>
>     .def("__str__", &operators::C::operator (const char*))
>
> But without success. Does anybody know how I can fix this?

Did you try a typedef?

    typedef char const* string;

    ...

         .def("__str__", &operators::C::operator string)

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com




More information about the Cplusplus-sig mailing list