[libcxx-commits] [PATCH] D131372: [libc++][spaceship] Implement std::variant::operator<=>
Adrian Vogelsgesang via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Aug 8 14:13:56 PDT 2022
avogelsgesang added inline comments.
================
Comment at: libcxx/include/__variant/monostate.h:33
+
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr strong_ordering operator<=>(monostate, monostate) noexcept { return strong_ordering::equal; }
----------------
as I learned today in a different review, `_LIBCPP_INLINE_VISIBILITY` was superseded by `_LIBCPP_HIDE_FROM_ABI` (see https://libcxx.llvm.org/DesignDocs/VisibilityMacros.html#visibility-macros)
================
Comment at: libcxx/test/std/utilities/variant/variant.monostate.relops/relops.pass.cpp:30
int main(int, char**) {
using M = std::monostate;
constexpr M m1{};
----------------
mumbleskates wrote:
> Mordante wrote:
> > Can you improve this test and the next by using the comparison macros and using our current constexpr test pattern
> >
> > ```
> > int main(int, const char**) {
> > test();
> > static_assert(test());
> >
> > return 0;
> > }
> > ```
> done
please also update `variant.relops/three_way.pass.cpp` to follow this `constexpr` testing pattern and use the comparison test macros
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D131372/new/
https://reviews.llvm.org/D131372
More information about the libcxx-commits
mailing list