is_constructible<int*,void*>
reports trueSection: 21.3.5.4 [meta.unary.prop] Status: Resolved Submitter: Peter Dimov Opened: 2009-11-07 Last modified: 2016-01-28
Priority: Not Prioritized
View other active issues in [meta.unary.prop].
View all other issues in [meta.unary.prop].
View all issues with Resolved status.
Discussion:
The specification of is_constructible<T,Args...>
in
N3000
uses
static_cast<T>(create<Args>()...)
for the one-argument case, but static_cast
also permits
unwanted conversions such as void*
to T*
and
Base*
to Derived*
.
[ Post-Rapperswil: ]
Moved to
NAD EditorialResolved, this issue is addressed by paper n3047
Proposed resolution:
Change 21.3.5.4 [meta.unary.prop], p6:
the predicate condition for a template specialization
is_constructible<T, Args>
shall be satisfied, if and only if the followingexpression CEvariable definition would be well-formed:
if
sizeof...(Args) == 0
1, the expression:static_cast<T>(create<Args>()...)T t;otherwise
the expression:T t(create<Args>()...);