[PATCH] D41458: [libc++][C++17] Elementary string conversions for integral types

Marshall Clow via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 16 09:04:00 PDT 2018


mclow.lists added inline comments.


================
Comment at: include/charconv:359
+    auto __gen_digit = [](_Tp __c) {
+        return "0123456789abcdefghijklmnopqrstuvwxyz"[__c];
+    };
----------------
Thinking some more - did this used to do more? Because I don't see why having a lambda here is a benefit, as compared to:

    const char *__digits = "0123456789abcdefghijklmnopqrstuvwxyz";

and
    *--p = digits[__c];



Repository:
  rCXX libc++

https://reviews.llvm.org/D41458





More information about the cfe-commits mailing list