N
Nicolas Weidmann
Hi,
I can compile the following code under g++ (using the -std=c++98), but not under
MS VC7.0 (.NET).
Is it illegal code or is it a limitation of the MS compiler?
Thank you.
Nicolas
template<class T> class Foo {
public:
T value;
};
namespace std {
template<class T> less<Foo<T> > {
bool operator ()(const Foo<T> &left, const Foo<T> &right) const
{
return left.value < right.value;
}
}
};
void bar()
{
std::set<Foo<int> > hello;
}
I can compile the following code under g++ (using the -std=c++98), but not under
MS VC7.0 (.NET).
Is it illegal code or is it a limitation of the MS compiler?
Thank you.
Nicolas
template<class T> class Foo {
public:
T value;
};
namespace std {
template<class T> less<Foo<T> > {
bool operator ()(const Foo<T> &left, const Foo<T> &right) const
{
return left.value < right.value;
}
}
};
void bar()
{
std::set<Foo<int> > hello;
}