Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

almost 6 years ago

Language

Compiler

Options

Author

anonymous

almost 6 years ago

$
In file included from prog.cc:1:
In file included from /opt/wandbox/clang-head/include/c++/v1/iostream:37:
In file included from /opt/wandbox/clang-head/include/c++/v1/ios:215:
In file included from /opt/wandbox/clang-head/include/c++/v1/__locale:14:
In file included from /opt/wandbox/clang-head/include/c++/v1/string:506:
In file included from /opt/wandbox/clang-head/include/c++/v1/string_view:175:
In file included from /opt/wandbox/clang-head/include/c++/v1/__string:57:
In file included from /opt/wandbox/clang-head/include/c++/v1/algorithm:640:
/opt/wandbox/clang-head/include/c++/v1/type_traits:542:78: error: no type named 'type' in 'std::__1::enable_if<false, void>'; 'enable_if' cannot be used to disable this declaration
template <bool _Bp, class _Tp = void> using enable_if_t = typename enable_if<_Bp, _Tp>::type;
                                                                             ^~~
prog.cc:7:12: note: in instantiation of template type alias 'enable_if_t' requested here
    X(std::enable_if_t<std::is_const<T>::value>* = nullptr) { std::cout << "do this"; }
           ^
prog.cc:12:12: note: in instantiation of template class 'X<int>' requested here
    X<int> x{};         // Error.
           ^
In file included from prog.cc:1:
In file included from /opt/wandbox/clang-head/include/c++/v1/iostream:37:
In file included from /opt/wandbox/clang-head/include/c++/v1/ios:215:
In file included from /opt/wandbox/clang-head/include/c++/v1/__locale:14:
In file included from /opt/wandbox/clang-head/include/c++/v1/string:506:
In file included from /opt/wandbox/clang-head/include/c++/v1/string_view:175:
In file included from /opt/wandbox/clang-head/include/c++/v1/__string:57:
In file included from /opt/wandbox/clang-head/include/c++/v1/algorithm:640:
/opt/wandbox/clang-head/include/c++/v1/type_traits:542:78: error: no type named 'type' in 'std::__1::enable_if<false, void>'; 'enable_if' cannot be used to disable this declaration
template <bool _Bp, class _Tp = void> using enable_if_t = typename enable_if<_Bp, _Tp>::type;
                                                                             ^~~
prog.cc:8:12: note: in instantiation of template type alias 'enable_if_t' requested here
    X(std::enable_if_t<!std::is_const<T>::value>* = nullptr) { std::cout << "do that"; }
           ^
prog.cc:13:18: note: in instantiation of template class 'X<const int>' requested here
    X<const int> xc{};  // Error.
                 ^
2 errors generated.
Exit Code:
1