Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <type_traits>
- template <typename T,typename = typename std::enable_if<std::is_arithmetic<T>::value,T>::type>
- class foo
- {
- public:
- void bar();
- };
- template <typename T>
- void foo<T>::bar ()
- {
- }
- error: invalid use of incomplete type 'class foo<T>'
- void foo<T>::bar ()
- ^
- error: declaration of 'class foo<T>'
- class foo
- ^
- #include <type_traits>
- template <typename T,typename = typename std::enable_if<std::is_arithmetic<T>::value,T>::type>
- class foo
- {
- public:
- void bar()
- {
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement