Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2004-01-07 10:38:44


Vérane Chanson <verane.chanson_at_[hidden]> writes:

> Hi all,
>
>
>
> I try to wrap the following class std ::vector<std ::string> with the
> following code :
>
>
>
> typedef std::vector<std::string> VectorString;
>
>
>
> class_<VectorString>("std_vector_string")
>
> .def("front", &VectorString::front)
>
> ;
>
>
>
> I get this error : error C2914: 'def' : cannot deduce template argument
> as function argument is ambiguous
>
>
>
> Does anyone know why ?

[Boost.Python posts should go to the C++-sig:
http://www.boost.org/more/mailing_lists.htm#cplussig]

It's because std::vector<std::string> has two "front" member
functions, one const, the other non-const. You're not allowed to take
the address of a standard library function or member function anyway.
I suggest you take a look at the indexing suite stuff in the CVS:

http://www.boost-consulting.com/boost/libs/python/doc/v2/indexing.html

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

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk