This page is a snapshot from the LWG issues list, see theLibrary Active Issues List for more information and the meaning ofCD1 status.
has_nothrow_copy_constructor<T>::value is true ifT has 'a' nothrow copy constructor.Section: 21.3.6.4[meta.unary.prop]Status:CD1Submitter: Alisdair MeredithOpened: 2007-10-10Last modified: 2016-01-28
Priority:Not Prioritized
View otheractive issues in [meta.unary.prop].
View all otherissues in [meta.unary.prop].
View all issues withCD1 status.
Discussion:
Unfortunately a class can have multiple copy constructors, and I believe tobe useful this trait should only return true is ALL copy constructors areno-throw.
For instance:
struct awkward { awkward( const awkward & ) throw() {} awkward( awkward & ) { throw "oops"; } };Proposed resolution:
Change 21.3.6.4[meta.unary.prop]:
has_trivial_copy_constructor
Tis a trivial type (3.9) or a reference type or a class typewith a trivial copy constructorwhere all copy constructors are trivial (12.8).
has_trivial_assign
Tis neitherconstnor a reference type, andTis a trivial type (3.9)or a class typewith a trivial copy assignment operatorwhere all copy assignment operators are trivial (12.8).
has_nothrow_copy_constructor
has_trivial_copy_constructor<T>::valueistrueorTis a class typewithawhere all copy constructorsthat isare known not to throw any exceptions orTis anarray of such a class type
has_nothrow_assign
Tis neitherconstnor a reference type, andhas_trivial_assign<T>::valueistrueorTis a class typewith awhere all copyassignment operators takeingan lvalue of typeTthat is known not tothrow any exceptions orTis an array of such a class type.