make_tuple with boost::python under Visual Studio 9 -
trying build following simple example
#include <boost/python.hpp> using namespace boost::python; tuple head_and_tail(object sequence) { return make_tuple(sequence[0],sequence[-1]); }
available here, end compilation error under visual studio 9
error c2668: 'boost::python::make_tuple' : ambiguous call overloaded function 1> c:\program files\boost_1_42_0\boost/python/detail/make_tuple.hpp(22): 'boost::python::tuple boost::python::make_tuple<boost::python::api::object_item,boost::python::api::object_item>(const a0 &,const a1 &)' 1> 1> [ 1> a0=boost::python::api::object_item, 1> a1=boost::python::api::object_item 1> ] 1> c:\program files\boost_1_42_0\boost/tuple/detail/tuple_basic.hpp(802): or 'boost::tuples::tuple<t0,t1,t2,t3,t4,t5,t6,t7,t8,t9> boost::tuples::make_tuple<boost::python::api::object_item,boost::python::api::object_item>(const t0 &,const t1 &)' [found using argument-dependent lookup] 1> 1> [ 1> t0=boost::python::api::proxy<boost::python::api::item_policies>, 1> t1=boost::python::api::proxy<boost::python::api::item_policies>, 1> t2=boost::tuples::null_type, 1> t3=boost::tuples::null_type, 1> t4=boost::tuples::null_type, 1> t5=boost::tuples::null_type, 1> t6=boost::tuples::null_type, 1> t7=boost::tuples::null_type, 1> t8=boost::tuples::null_type, 1> t9=boost::tuples::null_type 1> ]
is bug in boost::python, or doing wrong? how can above program compile?
using full namespace, fixes problem:
#include <boost/python.hpp> using namespace boost::python; tuple head_and_tail(object sequence) { return boost::python::make_tuple(sequence[0],sequence[-1]); }
Comments
Post a Comment