Essentially, I want to know whether it is legal to take a template
like
template<cla ss X> typename X::A Foo(typename X::B, typename X::C)
and specialise it in the case X takes some particular value, such as:
template<> typename Bar::A Foo<Bar>(typena me Bar::B, typename Bar::C)
Here is a complete example of what I am trying to do
-------------------------------------------------
template<class linktype> typename linktype::mychi ldset&
GetCList(typena me linktype::paren t&,linktype* =0);
struct UniqueID
{
typedef int mychildset;
typedef int parent;
};
int k;
template<> UniqueID::mychi ldset& GetCList<Unique ID>(UniqueID::p arent&
par,UniqueID*)
{
return k;
}
int main()
{
return 0;
}
-------------------------------------------------
..NET 2003 will not compile this code, giving the error message
"explicit specialization; 'UniqueID::mych ildset
&GetCList<Uniqu eID>(UniqueID:: parent &,UniqueID *)' is not a
specialization of a function template", whereas the original .NET
accepted it. I was wondering whether this was due to enhanced
standards conformance in '03, or whether it might have some other
cause (e.g. a compiler bug). (BTW, I tried the code on
www.comeaucomputing.com, which accepted it.) Any information
gratefully recieved!
Best,
Thomas Barnet-Lamb
Lionhead Studios Ltd.
www.lionhead.com