Title
Currently has_nothrow_copy_constructor<T>::value is true if T has 'a' nothrow copy constructor.
Status
cd1
Section
[meta.unary.prop]
Submitter
Alisdair Meredith

Created on 2007-10-10.00:00:00 last changed 172 months ago

Messages

Date: 2010-10-21.18:28:33

Proposed resolution:

Change [meta.unary.prop]:

has_trivial_copy_constructor

T is a trivial type (3.9) or a reference type or a class type with a trivial copy constructor where all copy constructors are trivial (12.8).

has_trivial_assign

T is neither const nor a reference type, and T is a trivial type (3.9) or a class type with a trivial copy assignment operator where all copy assignment operators are trivial (12.8).

has_nothrow_copy_constructor

has_trivial_copy_constructor<T>::value is true or T is a class type with a where all copy constructors that is are known not to throw any exceptions or T is an array of such a class type

has_nothrow_assign

T is neither const nor a reference type, and has_trivial_assign<T>::value is true or T is a class type with a where all copy assignment operators takeing an lvalue of type T that is known not to throw any exceptions or T is an array of such a class type.

Date: 2007-10-10.00:00:00

Unfortunately a class can have multiple copy constructors, and I believe to be useful this trait should only return true is ALL copy constructors are no-throw.

For instance:

struct awkward {
 awkward( const awkward & ) throw() {}
 awkward( awkward & ) { throw "oops"; } };
History
Date User Action Args
2010-10-21 18:28:33adminsetmessages: + msg3647
2007-10-10 00:00:00admincreate