[PATCH] D29930: Add `__is_direct_constructible` trait for checking safe reference initialization.

Eric Fiselier via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 14 14:20:49 PST 2017


EricWF added a comment.

In https://reviews.llvm.org/D29930#676858, @rsmith wrote:

> 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)?


That all sounds great to me. Thanks for the comments @rsmith. I'll update it tomorrow with the changes.


https://reviews.llvm.org/D29930





More information about the cfe-commits mailing list