|
Boost : |
Subject: Re: [boost] [type_traits] copy constructor
From: Vicente J. Botet Escriba (vicente.botet_at_[hidden])
Date: 2011-09-29 07:10:43
Le 29/09/11 04:57, Lorenzo Caminiti a écrit :
> Hello all,
>
> 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.)
>
>
Hi,
The proposed Boost.Conversion provides some interesting traits (included
in C++11) that you could be interested in.
is_constructible, is_default_constructible, is_copy_constructible,
is_move_constructible as well as is_assignable, is_copy_assignable and
is_move_assignable.
If John is interested in we can work together to include them in TypeTraits.
Best,
Vicente
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk