[libcxx-commits] [PATCH] D78427: [libcxx] Add c++20 <numbers>
    Zoe Carver via Phabricator via libcxx-commits 
    libcxx-commits at lists.llvm.org
       
    Tue Apr 21 11:52:49 PDT 2020
    
    
  
zoecarver added a comment.
Thanks for implementing this.
Please update `cxx2a_status.html`.
================
Comment at: libcxx/include/numbers:80
+template<class>
+inline constexpr bool value = false;
+
----------------
This needs to be mangled (`__value`). 
================
Comment at: libcxx/include/numbers:84
+constexpr T _AlwaysFalse() {
+   static_assert(value<T>, "Require Floating Point types");
+   return T();
----------------
Why not `static_assert(false)`? Wouldn't that be more clear? 
================
Comment at: libcxx/test/std/numerics/numbers/numbers.fail.cpp:18
+
+  constexpr int d = std::numbers::e_v<int>; // expected-error-re at numbers:* {{static_assert failed{{( due to requirement '.*')?}}}}
+  constexpr S1 s  = std::numbers::e_v<S1>;  // expected-error-re at numbers:* {{static_assert failed{{( due to requirement '.*')?}}}}
----------------
What's this testing? 
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D78427/new/
https://reviews.llvm.org/D78427
    
    
More information about the libcxx-commits
mailing list