[libcxx-commits] [PATCH] D58987: Make underlying_type SFINAE-friendly

Marshall Clow via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Mar 6 16:24:52 PST 2019


mclow.lists added inline comments.


================
Comment at: test/std/utilities/meta/meta.trans/meta.trans.other/underlying_type.pass.cpp:30
 
+template<class T>
+std::enable_if_t<
----------------
EricWF wrote:
> I'm not sure what this test is actually testing. How about:
> 
> ```
> template <class T, class = typename std::underlying_type<T>::type>
> std::true_type test_sfinae(int);
> template <class T>
> std::false_type test_sfinae(...);
> 
> int main() {
>   static_assert(decltype(test_sfinae<int>(0))::value == false, "not an enum");
>    static_assert(decltype(test_sfinae<E>(0))::value == true, "is an enum");
> 
> }
> ```
Now that we have the failing test, do we need this test at all?


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

https://reviews.llvm.org/D58987





More information about the libcxx-commits mailing list