Boost.Move BOOST_MOVABLE_BUT_NOT_COPYABLE macro
Due to GCC 4.7.2 and lower not supporting a change in template deduction rules as explained in the answer below http://stackoverflow.com/questions/14808663/stdunordered-mapemplace-issue-wi... the following code will not compile: #include <utility> class test { public: test() =default; private: test(test const&); }; int main() { std::is_convertible<test&, test>::value; }; For the same reason, it is not possible to use classes which use the BOOST_MOVABLE_BUT_NOT_COPYABLE in situations where libstdc++ uses std::is_convertible, for instance when using piecewise construction in std::unordered_map::emplace() (I came across the issue when making an unordered_map of boost::file_mapping) As deleting the copy constructor fixes the issue (i.e. test(test const&) =delete;), would it be at all possible for BOOST_MOVABLE_BUT_NOT_COPYABLE to do the same for compilers that support the syntax?
El 13/02/2013 6:36, luke escribió:
As deleting the copy constructor fixes the issue (i.e. test(test const&) =delete;), would it be at all possible for BOOST_MOVABLE_BUT_NOT_COPYABLE to do the same for compilers that support the syntax?
Thanks for reporting it. It's already done. See: https://svn.boost.org/trac/boost/ticket/7969 If you can confirm the issue is fixed in trunk, I'll close the bug. Best, Ion
participants (2)
-
Ion Gaztañaga
-
luke