Home | History | Annotate | Download | only in header.system_error.synop
      1 //===----------------------------------------------------------------------===//
      2 //
      3 //                     The LLVM Compiler Infrastructure
      4 //
      5 // This file is dual licensed under the MIT and the University of Illinois Open
      6 // Source Licenses. See LICENSE.TXT for details.
      7 //
      8 //===----------------------------------------------------------------------===//
      9 
     10 // UNSUPPORTED: c++98, c++03, c++11
     11 
     12 // <experimental/system_error>
     13 
     14 // template <class T> constexpr bool is_error_code_enum_v;
     15 
     16 #include <experimental/system_error>
     17 #include <ios> /* for std::io_errc */
     18 
     19 namespace ex = std::experimental;
     20 
     21 int main() {
     22   {
     23     static_assert(ex::is_error_code_enum_v<std::io_errc>, "");
     24 
     25     static_assert(ex::is_error_code_enum_v<std::io_errc> ==
     26                   std::is_error_code_enum <std::io_errc>::value, "");
     27 
     28     static_assert(std::is_same<decltype(ex::is_error_code_enum_v<std::io_errc>),
     29                                const bool>::value, "");
     30   }
     31   {
     32     static_assert(!ex::is_error_code_enum_v<int>, "");
     33 
     34     static_assert(ex::is_error_code_enum_v<int> ==
     35                   std::is_error_code_enum <int>::value, "");
     36   }
     37 }
     38