Boost logo

Boost :

Subject: Re: [boost] [type_traits] copy constructor
From: John Maddock (boost.regex_at_[hidden])
Date: 2011-09-29 06:33:48

> What's the most portable way to detect if a type T is CopyConstructible?
> Actually, I would need a metafunction that is true_ iff a type T has a
> const-correct copy construct:
> T::T( T const& other) { /* copy this T from the other T */ }
> (I've been looking at boost::has_trivial_copy and
> boost::has_nothrow_copy but I wanted to double check with the ML.)

There's no trait for that because we could think of no way of implementing
it: it would basically require a "does this code compile" compiler intrinsic
which vendors have been very reluctant to provide (read that as v. difficult
for them to implement).

HTH, John.

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