[libcxx-commits] [PATCH] D111516: [libc++][docs] Mark LWG3274 as complete

Joe Loser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Oct 11 09:23:28 PDT 2021


jloser added inline comments.


================
Comment at: libcxx/include/span:335
     _LIBCPP_INLINE_VISIBILITY constexpr size_type size_bytes() const noexcept { return _Extent * sizeof(element_type); }
-    _LIBCPP_INLINE_VISIBILITY constexpr bool empty()           const noexcept { return _Extent == 0; }
+    [[nodiscard]] _LIBCPP_INLINE_VISIBILITY constexpr bool empty() const noexcept { return _Extent == 0; }
 
----------------
Mordante wrote:
> Since the block was manually aligned it would be nice to keep it that way.
With adding `[[nodiscard]]` it won't be aligned with `size()` and `size_bytes()` member function. So, we can either manually align those, or not align `empty()` member function. I chose the latter. WDYT?


================
Comment at: libcxx/test/std/containers/views/span.obs/empty.nodiscard.verify.cpp:18
+//
+
+
----------------
Mordante wrote:
> Minor nit can you remove the `//` and the extra blank line?
Sure, but it's consistent with `empty.pass` where this was copied from for example. Several other tests have this same pattern.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D111516



More information about the libcxx-commits mailing list