
29 Sep
2011
29 Sep
'11
10:33 a.m.
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.