[libcxx-commits] [PATCH] D63053: Add nullptr output operator overload (2221)

Marshall Clow via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jun 10 14:09:52 PDT 2019


mclow.lists accepted this revision.
mclow.lists added a comment.
This revision is now accepted and ready to land.

Once you fix the nits, I think this is good to go.
Be sure to update `www/cxx1z_status.html` as well.



================
Comment at: include/ostream:223
+    basic_ostream& operator<<(nullptr_t)
+    { return *this << static_cast<const char*>("nullptr\0"); }
+
----------------
Don't need the `\0`; the compiler does that for you. 
Nor the static cast; the type of a string literal is `const char *` already.
Just say:
    { return *this << "nullptr"; }


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63053/new/

https://reviews.llvm.org/D63053





More information about the libcxx-commits mailing list