fork download
  1. #include <type_traits>
  2.  
  3. using namespace std;
  4.  
  5. template<typename T, typename... Args>
  6. struct is_nothrow_constructible_custom
  7. : public integral_constant<bool, noexcept(T(declval<Args>()...))>
  8. {};
  9.  
  10. class A
  11. {
  12. public:
  13. A(int) {}
  14. A(short) noexcept {}
  15. };
  16.  
  17. int main()
  18. {
  19. static_assert(is_nothrow_constructible_custom<A, int>::value == false, "");
  20. static_assert(is_nothrow_constructible_custom<A, short>::value == true, "");
  21. }
Success #stdin #stdout 0s 3136KB
stdin
Standard input is empty
stdout
Standard output is empty