This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Namespace and Specialization Trouble moving 2.95.2 code to 3.0.
- To: gcc at gcc dot gnu dot org
- Subject: Namespace and Specialization Trouble moving 2.95.2 code to 3.0.
- From: Benjamin Scherrey <scherrey at innoverse dot com>
- Date: Fri, 10 Aug 2001 15:21:38 -0400
- Organization: Innoverse, Inc.
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 ---