std::experimental::ranges::Constructible
Defined in header <experimental/ranges/concepts>
|
||
template < class T, class... Args > concept bool __ConstructibleObject = /* exposition only */ |
(ranges TS) | |
The concept Constructible<T, Args..>() is used to constrain a type to be either an object type constructible from a set of types, or a reference type that can be bound to those arguments.
Notes
As of the current working draft, Constructible<int&, char&>() is satisfied because the cast in __BindableReference is a reinterpret_cast.
Unlike std::is_constructible, Constructible
requires a new-expression to be valid and also uses list-initialization, where narrowing conversions are not allowed, initializer-list constructors are preferentially called, and aggregate initialization can be performed. For example:
- Constructible<int, double>() is not satisfied, even though ConvertibleTo<double, int>() is satisfied and std::is_constructible<int, double>::value is true.
- Given struct A { int a; };, Constructible<A, int>() is satisfied, even though std::is_constructible<A, int>::value is false.
See also
(C++11)(C++11)(C++11) |
checks if a type has a constructor for specific arguments (class template) |