[libcxx-commits] [PATCH] D144286: [libc++][format] Addresses LWG3839.

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Mar 7 10:19:45 PST 2023


Mordante marked 2 inline comments as done.
Mordante added a comment.

Thanks for the review.



================
Comment at: libcxx/test/std/utilities/format/format.tuple/set_separator.pass.cpp:41-42
   formatter.set_separator(SV("sep"));
+  // Note the SV macro may throw, so can't use it.
+  static_assert(noexcept(formatter.set_separator(std::basic_string_view<CharT>{})));
 
----------------
ldionne wrote:
> You could use `declval()` and perhaps remove the comment about the `SV` macro (here and everywhere else)?
I tried it and I'm not to thrilled by the code. I'll keep it as is. I think the comment is useful, originally I wrote
`static_assert(noexcept(formatter.set_separator(SV("sep"))));` which failed to compile since the SV macro could throw. Personally I like then to add a comment, to avoid the next developer to step in the same trap. In my experience the next developer is me in a couple of months ;-)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D144286



More information about the libcxx-commits mailing list