[libcxx-commits] [PATCH] D154590: [libc++] mark barrier constructor as constexpr explicit in <barrier>

Edo via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jul 7 06:46:09 PDT 2023


diamante0018 added a comment.

I am unfortunately struggling a bit to come up with the proper syntax to test for 'excplicit' ctor.

I have tried a few things but I can't understand how test_convertible should be used. Could someone point me in the right direction?

What I tried but failed:

  #if TEST_STD_VER >= 11
    using CompletionF = std::function<void()>;
    static_assert(!test_convertible<std::barrier, std::ptrdiff_t, CompletionF>(), "This constructor must be explicit");
  #endif

and

  static_assert(!test_convertible<std::barrier, std::ptrdiff_t, std::_CompletionF>(), "This constructor must be explicit"); // _CompletionF is not part of std

I am missing the point about how test_convertible should be used to test the ctor of a class that takes a function as a parameter

Thanks.


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

https://reviews.llvm.org/D154590



More information about the libcxx-commits mailing list