I'm compiling with VS10, and using Boost 1.49.0 “reference member is initialized to a temporary that doesn't persist after the constructor exits” That does not sound good, and browsing through the mailing list archives I see discussions of regressions in 2010 that cite C4413 and use of emplace. I can't read the source code because it's just a ball of preprocessor stuff. Is this a real problem or a warning that can be ignored? I would think that if Boost.Container was broken on VS10, it would be mentioned somewhere where it's easy to spot. Thanks, —John E:\boost_1_49\boost/preprocessor/iteration/detail/local.hpp(37): warning C4413: 'boost::container::container_detail::advanced_insert_aux_non_movable_emplace1arg<A,Iterator,P0>::m_p0' : reference member is initialized to a temporary that doesn't persist after the constructor exits with [ A=std::allocator<std::tr1::shared_ptr<MyTypeA>>, Iterator=std::tr1::shared_ptr<MyTypeA> *, P0=std::tr1::shared_ptr<MyTypeA> ] E:\boost_1_49\boost/preprocessor/iteration/detail/local.hpp(37) : see declaration of 'boost::container::container_detail::advanced_insert_aux_non_movable_emplace1arg<A,Iterator,P0>::m_p0' with [ A=std::allocator<std::tr1::shared_ptr<MyTypeA>>, Iterator=std::tr1::shared_ptr<MyTypeA> *, P0=std::tr1::shared_ptr<MyTypeA> ] E:\boost_1_49\boost/preprocessor/iteration/detail/local.hpp(37) : while compiling class template member function 'boost::container::container_detail::advanced_insert_aux_non_movable_emplace1arg<A,Iterator,P0>::advanced_insert_aux_non_movable_emplace1arg(A &,P0 &&)' with [ A=std::allocator<std::tr1::shared_ptr<MyTypeA>>, Iterator=std::tr1::shared_ptr<MyTypeA> *, P0=std::tr1::shared_ptr<MyTypeA> ] E:\boost_1_49\boost/preprocessor/iteration/detail/local.hpp(37) : see reference to class template instantiation 'boost::container::container_detail::advanced_insert_aux_non_movable_emplace1arg<A,Iterator,P0>' being compiled with [ A=std::allocator<std::tr1::shared_ptr<MyTypeA>>, Iterator=std::tr1::shared_ptr<MyTypeA> *, P0=std::tr1::shared_ptr<MyTypeA> ] E:\boost_1_49\boost/preprocessor/iteration/detail/local.hpp(37) : see reference to class template instantiation 'boost::container::container_detail::advanced_insert_aux_emplace1arg<A,Iterator,P0>' being compiled with [ A=std::allocator<std::tr1::shared_ptr<MyTypeA>>, Iterator=std::tr1::shared_ptr<MyTypeA> *, P0=std::tr1::shared_ptr<MyTypeA> ] mysourcefile.cpp(172) : see reference to function template instantiation 'void boost::container::vector<T>::emplace_back<std::tr1::shared_ptr<_Ty>>(P0 &&)' being compiled with [ T=std::tr1::shared_ptr<MyTypeA>, _Ty=MyTypeA, P0=std::tr1::shared_ptr<MyTypeA> ]
El 23/12/2013 20:41, John M. Dlugosz escribió:
I'm compiling with VS10, and using Boost 1.49.0 “reference member is initialized to a temporary that doesn't persist after the constructor exits” That does not sound good, and browsing through the mailing list archives I see discussions of regressions in 2010 that cite C4413 and use of emplace. I can't read the source code because it's just a ball of preprocessor stuff. Is this a real problem or a warning that can be ignored? I would think that if Boost.Container was broken on VS10, it would be mentioned somewhere where it's easy to spot.
I think this is related to the early and non-conforming VC2010 rvalue reference implementation. A workaround was found and the issue was fixed in later Boost releases. Best, Ion
participants (2)
-
Ion Gaztañaga
-
John M. Dlugosz