Subject: Re: [Boost-bugs] [Boost C++ Libraries] #11229: vector incorrectly copies move-only objects using memcpy
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-12-02 14:30:48
#11229: vector incorrectly copies move-only objects using memcpy
-------------------------------+------------------------
Reporter: joseph.thomson@⦠| Owner: igaztanaga
Type: Bugs | Status: new
Milestone: To Be Determined | Component: move
Version: Boost 1.58.0 | Severity: Problem
Resolution: | Keywords:
-------------------------------+------------------------
Comment (by joseph.thomson@â¦):
Actually, as far as I can see, the workaround will result in incorrect
behaviour. It's been a while since I filed the original ticket, so I can't
remember all the details, but I assume that the workaround exists to
emulate the old (incorrect) behaviour of GCC on Clang.
Implicitly generated, `default`ed and `delete`d copy constructors are
''all'' trivial. Thus, `boost::has_trivial_copy` should be true for a
`std::unique_ptr`. This reflects the new, ''correct'' behaviour of
`__has_trivial_copy` in GCC 4.9. However, to be trivially copy
constructible, a class must:
* have no non-trivial copy constructors, and
* be copy constructible.
A `std::unique_ptr` is not copy constructible, even thought it has a
trivial (`delete`d) copy constructor, so the standard library function
`std::is_trivially_copy_constructible` should be false for a
`std::unique_ptr`.
What I'm saying is that, if what you report is accurate, the behaviour of
`boost::has_trivial_copy` is currently wrong for both GCC ''and'' Clang.
It seemingly behaves like `std::is_trivially_copy_constructible`.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/11229#comment:10> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:19 UTC