[PATCH] D26332: Add a user-defined literal for StringRef

Zachary Turner via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 23 10:21:15 PST 2016


zturner added a comment.

In https://reviews.llvm.org/D26332#604537, @malcolm.parsons wrote:

> In https://reviews.llvm.org/D26332#604408, @zturner wrote:
>
> > If the goal here is to achieve constexprness so it doesn't require a static initializer, how about reviving Mehdi's patch which make the const char * constructor explicit, and then adding a constexpr char array constructor?
>
>
> A char array constructor cannot tell whether the array is a literal or not.
>  A UDL can only be called with a literal.


I think as Chandler said, perhaps taking this to llvm-dev where more people will have a chance to chime in might be a good path forward


https://reviews.llvm.org/D26332





More information about the llvm-commits mailing list