[libcxx-commits] [PATCH] D122806: [libc++] add zip_view and views::zip for C++23

Nikolas Klauser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Apr 1 02:54:04 PDT 2022


philnik added a comment.

Regarding clang-format, no we currently don't have a nice `.clang-format`. We are working on it, but it will probably take a while.



================
Comment at: libcxx/include/__ranges/zip_view.h:142-144
+    _LIBCPP_HIDE_FROM_ABI
+    constexpr explicit zip_view(_Views... __views)
+        : __views_(std::move(__views)...) {}
----------------
huixie90 wrote:
> philnik wrote:
> > The `constexpr`s should be on the same line as `_LIBCPP_HIDE_FROM_ABI`.
> I took a look at several other views (transform, single, subrange, take, join). they all have `_LIBCPP_HIDE_FROM_ABI` on a separate line.
> 
> A side question. why don't we put `_LIBCPP_HIDE_FROM_ABI` put on the class declaration so we can avoid putting `_LIBCPP_HIDE_FROM_ABI` on all member functions
I meant that it should be `_LIBCPP_HIDE_FROM_ABI constexpr`. Although I'm not actually sure that we use this style consistently. We probably don't use any style consistently.
As to why we put `_LIBCPP_HIDE_FROM_ABI` on every declaration I think that not all possible attributes in `_LIBCPP_HIDE_FROM_ABI` can be put on classes. I think the possible attributes are `__exclude_from_explicit_instantiation__`, `internal_linkage`, `always_inline`, `__visibility__("hidden")` and combinations.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D122806



More information about the libcxx-commits mailing list