Boost logo

Boost :

Subject: Re: [boost] [core/noncopyable][test/boost::unit_test::singleton] massive test failures
From: Peter Dimov (lists_at_[hidden])
Date: 2014-08-21 15:25:51

Agustín K-ballo Bergé wrote:
> I see trivially copyable as a permission to use memcpy/memmove to replace
> what would be a copy/move-construction, copy/move-assignment, and other
> operations derived from them (say swap) **if** the corresponding special
> member is provided and accessible.

If you never use is_trivially_copyable alone and always qualify it with &&
is_copy_constructible, I can see why you wouldn't mind
is_trivially_copyable<X> to be true while is_copy_constructible<X> to be

But the other side of the coin is that in this case you simply do not care
about what is_trivially_copyable returns. So there is no reason to object if
is_trivially_copyable returns false for noncopyable types.

Of course... you will counter that your uses of is_trivially_copyable are
sometimes qualified not by is_copy_constructible, but by

I admit that it is in principle possible for a trivially copyable, but
noncopyable, type to have an accessible move constructor. Specific examples
elude me as usual. :-)

Boost list run by bdawes at, gregod at, cpdaniel at, john at