B
Belebele
in t.cpp:
#include <boost/type_traits.hpp>
#include <boost/utility.hpp>
template <typename T>
struct Foo {
typename boost::enable_if<boost::is_pointer<T>, void>::type
bar(T ) const {
}
typename boost::disable_if<boost::is_pointer<T>, void>::type
bar(T ) const {
}
};
void call_bar()
{
Foo<int>().bar(5);
}
// end
$ g++ -c -I/my/path/to/boost t.cpp
t.cpp: In instantiation of 'Foo<int>':
t.cpp:18: instantiated from here
t.cpp:7: error: no type named 'type' in 'struct
boost::enable_if<boost::is_pointer ....
$ g++ --v
gcc version 4.1.2
What happen to my sfinae?
Thanks
#include <boost/type_traits.hpp>
#include <boost/utility.hpp>
template <typename T>
struct Foo {
typename boost::enable_if<boost::is_pointer<T>, void>::type
bar(T ) const {
}
typename boost::disable_if<boost::is_pointer<T>, void>::type
bar(T ) const {
}
};
void call_bar()
{
Foo<int>().bar(5);
}
// end
$ g++ -c -I/my/path/to/boost t.cpp
t.cpp: In instantiation of 'Foo<int>':
t.cpp:18: instantiated from here
t.cpp:7: error: no type named 'type' in 'struct
boost::enable_if<boost::is_pointer ....
$ g++ --v
gcc version 4.1.2
What happen to my sfinae?
Thanks