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

Pete Cooper via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 9 11:04:43 PST 2016


> On Nov 9, 2016, at 7:17 AM, Zachary Turner <zturner at google.com> wrote:
> 
> I think chandlerc has been OOO, so let's wait and see what he has to say
For such a drastic change in style I think this needs to be a discussion on llvm-dev and if we take it, an addition to the LLVM style guide.

Personally I’m strongly against the syntax so i’d prefer we don’t use UDL’s anywhere in LLVM, but thats just my opinion.

Pete
> On Wed, Nov 9, 2016 at 5:33 AM Malcolm Parsons <malcolm.parsons at gmail.com <mailto:malcolm.parsons at gmail.com>> wrote:
> malcolm.parsons added a comment.
> 
> The LLVM coding standards don't mention UDL.
> 
> The Google C++ Style Guide says
> Pro: User-defined literals are a very concise notation for creating objects of user-defined types.
> Con: User-defined literals allow the creation of new syntactic forms that are unfamiliar even to experienced C++ programmers.
> Decision: Do not overload operator"", i.e. do not introduce user-defined literals
> 
> http://open-std.org/JTC1/SC22/WG21/docs/papers/2016/p0403r0.html <http://open-std.org/JTC1/SC22/WG21/docs/papers/2016/p0403r0.html> proposes a UDL for std::string_view.
> 
> I think the pros outweigh the cons.
> 
> 
> https://reviews.llvm.org/D26332 <https://reviews.llvm.org/D26332>
> 
> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161109/ba0bb7be/attachment.html>


More information about the llvm-commits mailing list