Namespace and Specialization Trouble moving 2.95.2 code to 3.0.
Benjamin Scherrey
scherrey@innoverse.com
Fri Aug 10 12:25:00 GMT 2001
The following code is giving me a headache.
It complains that I'm "specializing 'struct std::less<Armour::VHandle<T> >'
in different namespace from definition of 'template<class _Tp> struct
std::less'.
I've tried moving the extent of the namespaces around and changing using
directives but I guess I just don't understand the error message. This is
code that works in 2.95.2 that I'm trying to get to build in 3.0. I guess I'm
throwing this exception to this list in hopes it doesn't reach terminate! :-)
Thanx for a clue,
Ben Scherrey
--- start code ---
using namespace std;
namespace Armour
{
template < typename T > class VHandle
{
// stuff goes here
};
} // eons Armour
// BDM3 - std:: prefix
template < typename T > struct std::less< Armour::VHandle<T> >
: std::binary_function< Armour::VHandle<T>, Armour::VHandle<T>, bool >
{
bool operator()( const Armour::VHandle<T>& a, const Armour::VHandle<T>& b
) const
{
return a.ref() < b.ref();
}
};
--- end code ---
More information about the Gcc
mailing list