[libcxx-commits] [PATCH] D58642: Second part of P1227R2 - Signed ssize() functions, unsigned size() functions

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Feb 26 15:54:41 PST 2019


ldionne added inline comments.


================
Comment at: libcxx/include/iterator:1868
+template <class _Cont>
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr auto ssize(const _Cont& __c)
----------------
Is there a reason for making this `inline`? Templates are already `inline` by default.


================
Comment at: libcxx/test/std/iterators/iterator.container/ssize.pass.cpp:42
+{
+//  ASSERT_NOEXCEPT(std::size(c));
+    static_assert( std::is_signed_v<decltype(std::ssize(c))>, "");
----------------
Why is this commented? I think we can have a libc++ specific check here because our `std::size(Container const&)` is marked `noexcept` conditionally on the `noexcept`-ness of `container.size()`.


================
Comment at: libcxx/test/std/iterators/iterator.container/ssize.pass.cpp:59
+{
+//  ASSERT_NOEXCEPT(std::size(c));
+//  For some reason, there isn't a std::size() for initializer lists, so it uses the generic one
----------------
ditto


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

https://reviews.llvm.org/D58642





More information about the libcxx-commits mailing list