[PATCH] D29930: Add `__is_direct_constructible` trait for checking safe reference initialization.
Richard Smith via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Feb 14 14:19:27 PST 2017
rsmith added a comment.
I don't like this name; it sounds too much like you're asking whether a certain direct-initialization is possible, which is what `__is_constructible` does. I also don't like the idea of combining an "is this type direct-initializable from this list of arguments" check with a reference-specific side-check; it seems better to expose the underlying check itself and allow the user to figure out how they want to combine the checks.
Perhaps we could introduce a `__reference_binds_to_temporary(T, U)` trait, where `T` is required to be a reference type, that determines whether a reference of type `T` bound to an expression of type `U` would bind to a materialized temporary object (or subobject thereof)?
https://reviews.llvm.org/D29930
More information about the cfe-commits
mailing list