|
Boost Users : |
From: Persson Jonas (Jonas.Persson_at_[hidden])
Date: 2002-05-21 04:04:18
Hello,
I've just started playing around with BLL and i have some
troubles using it with containers of shared_ptr. I have
isolated the problem to:
void lambdaTest() {
using namespace boost::lambda;
boost::shared_ptr<int> x(new int(5));
(*_1)(x);
}
This does not compile with gcc 3.1 on cygwin.
If I use plain pointers it works as expected but not for shared_ptr.
What am I doing wrong?
/ Jonas
----------------------------------------------------------------------------
---- ../../cygwin/usr/local/include/g++-v3/bits/stl_iterator_base_types.h: In instantiation of `std::iterator_traits<boost::s hared_ptr<int> >': ../../libs/boost_1_28_0/boost/lambda/detail/operator_return_type_traits.hpp: 224: instantiated from `boost::lambda::det ail::contentsof_type<boost::shared_ptr<int> >' ../../libs/boost_1_28_0/boost/lambda/detail/lambda_traits.hpp:50: instantiated from `boost::lambda::detail::IF_type_<b oost::lambda::detail::contentsof_type<boost::shared_ptr<int> > >' ../../libs/boost_1_28_0/boost/lambda/detail/lambda_traits.hpp:58: instantiated from `boost::lambda::detail::IF_type<tr ue, boost::lambda::detail::contentsof_type<boost::shared_ptr<int> >, boost::lambda::detail::identity_mapping<boost::lamb da::detail::unspecified> >' ../../libs/boost_1_28_0/boost/lambda/detail/operator_return_type_traits.hpp: 317: instantiated from `boost::lambda::ret urn_type_1<boost::lambda::other_action<boost::lambda::contentsof_action>, boost::shared_ptr<int>&>' ../../libs/boost_1_28_0/boost/lambda/detail/return_type_traits.hpp:92: instantiated from `boost::lambda::return_type_1 _prot<boost::lambda::other_action<boost::lambda::contentsof_action>, boost::shared_ptr<int>&>' ../../libs/boost_1_28_0/boost/lambda/detail/operator_lambda_func_base.hpp:84 : instantiated from `boost::lambda::detail ::unary_rt<boost::lambda::other_action<boost::lambda::contentsof_action>, boost::tuples::tuple<boost::lambda::lambda_fun ctor<boost::lambda::placeholder<1> >, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boos t::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_ type, boost::tuples::null_type>, boost::tuples::tuple<boost::shared_ptr<int>&, boost::tuples::null_type, boost::tuples:: null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost ::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type> >' ../../libs/boost_1_28_0/boost/lambda/detail/operator_lambda_func_base.hpp:25 3: instantiated from `boost::lambda::lambd a_functor_base<boost::lambda::other_action<boost::lambda::contentsof_action> , boost::tuples::tuple<boost::lambda::lambda _functor<boost::lambda::placeholder<1> >, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::n ull_type, boost::tuples::null_type> >::sig<boost::tuples::tuple<boost::shared_ptr<int>&, boost::tuples::null_type, boost ::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_t ype, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type> >' Main.cpp:150: instantiated from here ../../cygwin/usr/local/include/g++-v3/bits/stl_iterator_base_types.h:123: no type named `iterator_category' in `class boost::shared_ptr<int>' ../../cygwin/usr/local/include/g++-v3/bits/stl_iterator_base_types.h:124: no type named `value_type' in `class boost::shared_ptr<int>' ../../cygwin/usr/local/include/g++-v3/bits/stl_iterator_base_types.h:125: no type named `difference_type' in `class boost::shared_ptr<int>' ../../cygwin/usr/local/include/g++-v3/bits/stl_iterator_base_types.h:126: no type named `pointer' in `class boost::shared_ptr<int>' ../../cygwin/usr/local/include/g++-v3/bits/stl_iterator_base_types.h:127: no type named `reference' in `class boost::shared_ptr<int>' ../../libs/boost_1_28_0/boost/lambda/detail/operator_return_type_traits.hpp: In instantiation of `boost::lambda::detail: :contentsof_type<boost::shared_ptr<int> >': ../../libs/boost_1_28_0/boost/lambda/detail/lambda_traits.hpp:50: instantiated from `boost::lambda::detail::IF_type_<b oost::lambda::detail::contentsof_type<boost::shared_ptr<int> > >' ../../libs/boost_1_28_0/boost/lambda/detail/lambda_traits.hpp:58: instantiated from `boost::lambda::detail::IF_type<tr ue, boost::lambda::detail::contentsof_type<boost::shared_ptr<int> >, boost::lambda::detail::identity_mapping<boost::lamb da::detail::unspecified> >' ../../libs/boost_1_28_0/boost/lambda/detail/operator_return_type_traits.hpp: 317: instantiated from `boost::lambda::ret urn_type_1<boost::lambda::other_action<boost::lambda::contentsof_action>, boost::shared_ptr<int>&>' ../../libs/boost_1_28_0/boost/lambda/detail/return_type_traits.hpp:92: instantiated from `boost::lambda::return_type_1 _prot<boost::lambda::other_action<boost::lambda::contentsof_action>, boost::shared_ptr<int>&>' ../../libs/boost_1_28_0/boost/lambda/detail/operator_lambda_func_base.hpp:84 : instantiated from `boost::lambda::detail ::unary_rt<boost::lambda::other_action<boost::lambda::contentsof_action>, boost::tuples::tuple<boost::lambda::lambda_fun ctor<boost::lambda::placeholder<1> >, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boos t::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_ type, boost::tuples::null_type>, boost::tuples::tuple<boost::shared_ptr<int>&, boost::tuples::null_type, boost::tuples:: null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost ::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type> >' ../../libs/boost_1_28_0/boost/lambda/detail/operator_lambda_func_base.hpp:25 3: instantiated from `boost::lambda::lambd a_functor_base<boost::lambda::other_action<boost::lambda::contentsof_action> , boost::tuples::tuple<boost::lambda::lambda _functor<boost::lambda::placeholder<1> >, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::n ull_type, boost::tuples::null_type> >::sig<boost::tuples::tuple<boost::shared_ptr<int>&, boost::tuples::null_type, boost ::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_t ype, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type> >' Main.cpp:150: instantiated from here ../../libs/boost_1_28_0/boost/lambda/detail/operator_return_type_traits.hpp: 224: no type named `reference' in `struct std::iterator_traits<boost::shared_ptr<int> >' ../../libs/boost_1_28_0/boost/lambda/detail/lambda_traits.hpp: In instantiation of `boost::lambda::detail::IF_type_<boos t::lambda::detail::contentsof_type<boost::shared_ptr<int> > >': ../../libs/boost_1_28_0/boost/lambda/detail/lambda_traits.hpp:58: instantiated from `boost::lambda::detail::IF_type<tr ue, boost::lambda::detail::contentsof_type<boost::shared_ptr<int> >, boost::lambda::detail::identity_mapping<boost::lamb da::detail::unspecified> >' ../../libs/boost_1_28_0/boost/lambda/detail/operator_return_type_traits.hpp: 317: instantiated from `boost::lambda::ret urn_type_1<boost::lambda::other_action<boost::lambda::contentsof_action>, boost::shared_ptr<int>&>' ../../libs/boost_1_28_0/boost/lambda/detail/return_type_traits.hpp:92: instantiated from `boost::lambda::return_type_1 _prot<boost::lambda::other_action<boost::lambda::contentsof_action>, boost::shared_ptr<int>&>' ../../libs/boost_1_28_0/boost/lambda/detail/operator_lambda_func_base.hpp:84 : instantiated from `boost::lambda::detail ::unary_rt<boost::lambda::other_action<boost::lambda::contentsof_action>, boost::tuples::tuple<boost::lambda::lambda_fun ctor<boost::lambda::placeholder<1> >, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boos t::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_ type, boost::tuples::null_type>, boost::tuples::tuple<boost::shared_ptr<int>&, boost::tuples::null_type, boost::tuples:: null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost ::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type> >' ../../libs/boost_1_28_0/boost/lambda/detail/operator_lambda_func_base.hpp:25 3: instantiated from `boost::lambda::lambd a_functor_base<boost::lambda::other_action<boost::lambda::contentsof_action> , boost::tuples::tuple<boost::lambda::lambda _functor<boost::lambda::placeholder<1> >, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::n ull_type, boost::tuples::null_type> >::sig<boost::tuples::tuple<boost::shared_ptr<int>&, boost::tuples::null_type, boost ::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_t ype, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type> >' Main.cpp:150: instantiated from here ../../libs/boost_1_28_0/boost/lambda/detail/lambda_traits.hpp:50: no type named `type' in `struct boost::lambda::detail::contentsof_type<boost::shared_ptr<int> >' ../../libs/boost_1_28_0/boost/lambda/detail/lambda_traits.hpp: In instantiation of `boost::lambda::detail::IF_type<true, boost::lambda::detail::contentsof_type<boost::shared_ptr<int> >, boost::lambda::detail::identity_mapping<boost::lambda: :detail::unspecified> >': ../../libs/boost_1_28_0/boost/lambda/detail/operator_return_type_traits.hpp: 317: instantiated from `boost::lambda::ret urn_type_1<boost::lambda::other_action<boost::lambda::contentsof_action>, boost::shared_ptr<int>&>' ../../libs/boost_1_28_0/boost/lambda/detail/return_type_traits.hpp:92: instantiated from `boost::lambda::return_type_1 _prot<boost::lambda::other_action<boost::lambda::contentsof_action>, boost::shared_ptr<int>&>' ../../libs/boost_1_28_0/boost/lambda/detail/operator_lambda_func_base.hpp:84 : instantiated from `boost::lambda::detail ::unary_rt<boost::lambda::other_action<boost::lambda::contentsof_action>, boost::tuples::tuple<boost::lambda::lambda_fun ctor<boost::lambda::placeholder<1> >, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boos t::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_ type, boost::tuples::null_type>, boost::tuples::tuple<boost::shared_ptr<int>&, boost::tuples::null_type, boost::tuples:: null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost ::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type> >' ../../libs/boost_1_28_0/boost/lambda/detail/operator_lambda_func_base.hpp:25 3: instantiated from `boost::lambda::lambd a_functor_base<boost::lambda::other_action<boost::lambda::contentsof_action> , boost::tuples::tuple<boost::lambda::lambda _functor<boost::lambda::placeholder<1> >, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::n ull_type, boost::tuples::null_type> >::sig<boost::tuples::tuple<boost::shared_ptr<int>&, boost::tuples::null_type, boost ::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_t ype, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type> >' Main.cpp:150: instantiated from here ../../libs/boost_1_28_0/boost/lambda/detail/lambda_traits.hpp:58: no type named `type' in `struct boost::lambda::detail::IF_type_<boost::lambda::detail::contentsof_type<boost ::shared_ptr<int> > >' ../../libs/boost_1_28_0/boost/lambda/detail/operator_return_type_traits.hpp: In instantiation of `boost::lambda::return_ type_1<boost::lambda::other_action<boost::lambda::contentsof_action>, boost::shared_ptr<int>&>': ../../libs/boost_1_28_0/boost/lambda/detail/return_type_traits.hpp:92: instantiated from `boost::lambda::return_type_1 _prot<boost::lambda::other_action<boost::lambda::contentsof_action>, boost::shared_ptr<int>&>' ../../libs/boost_1_28_0/boost/lambda/detail/operator_lambda_func_base.hpp:84 : instantiated from `boost::lambda::detail ::unary_rt<boost::lambda::other_action<boost::lambda::contentsof_action>, boost::tuples::tuple<boost::lambda::lambda_fun ctor<boost::lambda::placeholder<1> >, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boos t::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_ type, boost::tuples::null_type>, boost::tuples::tuple<boost::shared_ptr<int>&, boost::tuples::null_type, boost::tuples:: null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost ::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type> >' ../../libs/boost_1_28_0/boost/lambda/detail/operator_lambda_func_base.hpp:25 3: instantiated from `boost::lambda::lambd a_functor_base<boost::lambda::other_action<boost::lambda::contentsof_action> , boost::tuples::tuple<boost::lambda::lambda _functor<boost::lambda::placeholder<1> >, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::n ull_type, boost::tuples::null_type> >::sig<boost::tuples::tuple<boost::shared_ptr<int>&, boost::tuples::null_type, boost ::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_t ype, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type> >' Main.cpp:150: instantiated from here ../../libs/boost_1_28_0/boost/lambda/detail/operator_return_type_traits.hpp: 317: no type named `type' in `struct boost::lambda::detail::IF_type<true, boost::lambda::detail::contentsof_type<boost::shared_ptr<int> >, boost::lambda::detail::identity_mapping<boost::lambda::detail::unspecified> >' ../../libs/boost_1_28_0/boost/lambda/detail/return_type_traits.hpp: In instantiation of `boost::lambda::return_type_1_pr ot<boost::lambda::other_action<boost::lambda::contentsof_action>, boost::shared_ptr<int>&>': ../../libs/boost_1_28_0/boost/lambda/detail/operator_lambda_func_base.hpp:84 : instantiated from `boost::lambda::detail ::unary_rt<boost::lambda::other_action<boost::lambda::contentsof_action>, boost::tuples::tuple<boost::lambda::lambda_fun ctor<boost::lambda::placeholder<1> >, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boos t::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_ type, boost::tuples::null_type>, boost::tuples::tuple<boost::shared_ptr<int>&, boost::tuples::null_type, boost::tuples:: null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost ::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type> >' ../../libs/boost_1_28_0/boost/lambda/detail/operator_lambda_func_base.hpp:25 3: instantiated from `boost::lambda::lambd a_functor_base<boost::lambda::other_action<boost::lambda::contentsof_action> , boost::tuples::tuple<boost::lambda::lambda _functor<boost::lambda::placeholder<1> >, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::n ull_type, boost::tuples::null_type> >::sig<boost::tuples::tuple<boost::shared_ptr<int>&, boost::tuples::null_type, boost ::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_t ype, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type> >' Main.cpp:150: instantiated from here ../../libs/boost_1_28_0/boost/lambda/detail/return_type_traits.hpp:92: no type named `type' in `struct boost::lambda::return_type_1<boost::lambda::other_action<boost::lambda::cont entsof_action>, boost::shared_ptr<int>&>' ../../libs/boost_1_28_0/boost/lambda/detail/operator_lambda_func_base.hpp: In instantiation of `boost::lambda::detail::u nary_rt<boost::lambda::other_action<boost::lambda::contentsof_action>, boost::tuples::tuple<boost::lambda::lambda_functo r<boost::lambda::placeholder<1> >, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost:: tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_typ e, boost::tuples::null_type>, boost::tuples::tuple<boost::shared_ptr<int>&, boost::tuples::null_type, boost::tuples::nul l_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::t uples::null_type, boost::tuples::null_type, boost::tuples::null_type> >': ../../libs/boost_1_28_0/boost/lambda/detail/operator_lambda_func_base.hpp:25 3: instantiated from `boost::lambda::lambd a_functor_base<boost::lambda::other_action<boost::lambda::contentsof_action> , boost::tuples::tuple<boost::lambda::lambda _functor<boost::lambda::placeholder<1> >, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::n ull_type, boost::tuples::null_type> >::sig<boost::tuples::tuple<boost::shared_ptr<int>&, boost::tuples::null_type, boost ::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_t ype, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type> >' Main.cpp:150: instantiated from here ../../libs/boost_1_28_0/boost/lambda/detail/operator_lambda_func_base.hpp:84 : no type named `type' in `struct boost::lambda::return_type_1_prot<boost::lambda::other_action<boost::lambda: :contentsof_action>, boost::shared_ptr<int>&>' ../../libs/boost_1_28_0/boost/lambda/detail/operator_lambda_func_base.hpp: In instantiation of `boost::lambda::lambda_fu nctor_base<boost::lambda::other_action<boost::lambda::contentsof_action>, boost::tuples::tuple<boost::lambda::lambda_fun ctor<boost::lambda::placeholder<1> >, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boos t::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_ type, boost::tuples::null_type> >::sig<boost::tuples::tuple<boost::shared_ptr<int>&, boost::tuples::null_type, boost::tu ples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type> >': Main.cpp:150: instantiated from here ../../libs/boost_1_28_0/boost/lambda/detail/operator_lambda_func_base.hpp:25 3: no type named `type' in `class boost::lambda::detail::unary_rt<boost::lambda::other_action<boost::lambda::c ontentsof_action>, boost::tuples::tuple<boost::lambda::lambda_functor<boost::lambda::placeholde r<1> >, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type>, boost::tuples::tuple<boost::shared_ptr<int>&, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type> >' Main.cpp: In function `void lambdaTest()': Main.cpp:150: no match for call to `(const boost::lambda::lambda_functor<boost::lambda::lambda_functor_base<boost::lamb da::other_action<boost::lambda::contentso f_action>, boost::tuples::tuple<boost::lambda::lambda_functor<boost::lambda::placeholde r<1> >, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type> > >) (boost::shared_ptr<int>&)' ../../libs/boost_1_28_0/boost/lambda/detail/lambda_functors.hpp:142: candidates are: T::sig<boost::tuples::null_type>::type boost::lambda::lambda_functor<Base>::operator()() const [with T = boost::lambda::lambda_functor_base<boost::lambda::other_action<boost::lambda ::contentsof_action>, boost::tuples::tuple<boost::lambda::lambda_functor<boost::lambda::placeholde r<1> >, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type> >]
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net