id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 7391,phoenix::insert compile fails with libc++,Naomasa Matsubayashi,Thomas Heller,"Following code produces a compile error with libc++. {{{ #include #include int main() { std::vector< int > hoge; std::vector< int > fuga; namespace phx = boost::phoenix; phx::insert( phx::placeholders::_1, phx::placeholders::_2, fuga.begin(), fuga.end() )( hoge, hoge.end() ); } }}} That is because phoenix::insert expects the member function insert returns void when was is called with 3 arguments. That is correct in C++03 but not in C++11.( All insert overloads returns an iterator in C++11 [23.3.7.1] ) Since libstdc++ returns void even if the code was compiled as C++11, the problem doesn't appear. But at least with libc++, it fails to compile and following error message is produced. {{{ void function 'operator()' should not return a value [-Wreturn-type] return c.insert(arg1, arg2, arg3); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~ }}} This patch fixed the problem on libc++. I think it needs more intelligent way to detect environments those insert always return a iterator. But I don't have any good idea on that :( {{{ --- boost/phoenix/stl/container/container.hpp +++ boost/phoenix/stl/container/container.hpp @@ -425,6 +425,9 @@ choice_1; typedef +#ifdef _LIBCPP_VERSION + iterator_of +#else boost::mpl::eval_if_c< boost::mpl::and_< boost::is_same @@ -433,8 +436,8 @@ , iterator_of , boost::mpl::identity > +#endif choice_2; - public: typedef typename }}}",Bugs,closed,To Be Determined,phoenix,Boost Development Trunk,Problem,fixed,,