Topic: partial member template specialization ... will it ever be supported?
Author: dkouroun@cc.uoi.gr
Date: Tue, 29 Nov 2005 00:16:25 CST Raw View
Dear list,
I have encountered strong limitations in C++ standard,
which have really slow down my developing. Using C++
templates, I really feel grounded when I have to write,
3*4*2 explicit template specializations for a class member
where the class takes 3 template parameters when I
only need to write 2 partial member specializations for the
third template parameter of the class. Partial member template
specialization is not supported by C++ and I do not know why!
1) Is there anybody in that list who shares the same feelings about
partial member template specializations?
2) Is there anybody who knows why this feature is not supported?
3) Is there anyone who knows if it will ever be supported so as to make
our "C++ life" easier?
Thank you all for your time!
D.K.
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Author: dkouroun@cc.uoi.gr
Date: Tue, 29 Nov 2005 09:11:45 CST Raw View
If it is not clear what do I mean by the term
partial member template specialization
here it is in action ...
template<typename A, typename B, typename C>
class MyClass
{
public:
void f(const double x);
};
template<typename A, typename B, typename C> void
MyClass<A, B, C>::f(const double x)
{
// do something with x in the general case
}
template<typename A, typename B>
MyClass<A, B, double>::f(const double x)
{
// do something else with x in the case where
// the template parameter C is double
}
C++ doesn't allow this at the moment. This is annoying.
I have to write explicit specializations for all the cases
A = ... and B = ... and C= ... .That means that if A can
be 3 different types B also 3 different types and C 3 different
types, I have to write explicit specializations for 3*3*3 = 27 cases.
This is unacceptable for a high level language as C++ and specially
for templates which were created to allow high level abstractions.
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Author: "Greg Herlihy" <greghe@pacbell.net>
Date: Tue, 29 Nov 2005 21:35:21 CST Raw View
dkouroun@cc.uoi.gr wrote:
> If it is not clear what do I mean by the term
> partial member template specialization
> here it is in action ...
>
> template<typename A, typename B, typename C>
> class MyClass
> {
> public:
> void f(const double x);
> };
>
> template<typename A, typename B, typename C> void
> MyClass<A, B, C>::f(const double x)
> {
> // do something with x in the general case
> }
>
> template<typename A, typename B>
> MyClass<A, B, double>::f(const double x)
> {
> // do something else with x in the case where
> // the template parameter C is double
> }
>
> C++ doesn't allow this at the moment. This is annoying.
> I have to write explicit specializations for all the cases
> A = ... and B = ... and C= ... .That means that if A can
> be 3 different types B also 3 different types and C 3 different
> types, I have to write explicit specializations for 3*3*3 = 27 cases.
The program needs to declare a partial specialization for MyClass
before specializing one of its methods for that partial specialization.
So after the class template declaration:
template<typename A, typename B, typename C>
class MyClass
{
public:
void f( double x);
};
Declare a partial specialization:
template<typename A, typename B>
class MyClass<A, B, double>
{
public:
void f( double x);
};
Now the method f may be defined:
template<typename A, typename B>
void MyClass<A, B, double>::f( double x)
{
// do something else with x in the case where
// the template parameter C is double
}
Greg
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Author: dkouroun@cc.uoi.gr
Date: Wed, 30 Nov 2005 00:18:32 CST Raw View
Thank you Greg,
but this is not what one would like to have here.
The same way specialization works for classes,
one should expect that it should work for members
as well. The way you are suggesting doesn't solve
the abstraction problem since one has to define not
only MyClass<A, B, double>::f(double) but all the other
functions of that class as well. Suppose I have 15 functions
there. Then for each specialized class I have to rewrite them
again and again and again.
Since I want to avoid rewritting issues I use templates. But
as you realize as well here templates do not solve the
"rewritting" problem.
Any other idea?
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Author: spam@spamguard.com ("Gene Bushuyev")
Date: Wed, 30 Nov 2005 07:41:59 GMT Raw View
<dkouroun@cc.uoi.gr> wrote in message
news:1133331241.248589.54170@g49g2000cwa.googlegroups.com...
> Thank you Greg,
> but this is not what one would like to have here.
> The same way specialization works for classes,
> one should expect that it should work for members
> as well. The way you are suggesting doesn't solve
> the abstraction problem since one has to define not
> only MyClass<A, B, double>::f(double) but all the other
> functions of that class as well. Suppose I have 15 functions
Specializing only some functions of a class template is not a good design
anyway, as it mixes specialization dependent and independent parts and prevents
a class template from being specialized later.
> there. Then for each specialized class I have to rewrite them
> again and again and again.
Not necessary. Since that functionality doesn't depend on specializations it
should be refactored into a separate class template.
-- Gene Bushuyev
----------------------------------------------------------------
There is no greatness where there is no simplicity, goodness and truth. ~ Leo
Tolstoy
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Author: dkouroun@cc.uoi.gr
Date: Wed, 30 Nov 2005 09:06:21 CST Raw View
Thanks for the feedback,
>Specializing only some functions of a class template is not a good design
>anyway, as it mixes specialization dependent and independent parts and prevents
>a class template from being specialized later.
I do not agree. One way of doing things is having a template
class and then specializing some of its members. This is really
nice design, since you can have sort and easily maintained code.
If you need though to specialize that class later on, then this is
of course not the way one should go. So I believe that there is
not point on what you claim above, since you compare two
completely different cases which cannot be compared.
If for instance the problem I am after needs specialized versions
of a class then I will design my code in such a way that it
specializes classes. When my problem just needs different
functionalities for specific template arguments I should be
able (I am not by the way because C++ standard prevents this)
to specialize "partially" the members of the class which should
provide the extra functionality. These are two different
approaches and there is only one choice to make depending
on what problem you want to solve.
>> there. Then for each specialized class I have to rewrite them
>> again and again and again.
>Not necessary. Since that functionality doesn't depend on specializations it
>should be refactored into a separate class template.
It is necessary because in my case those functions use data
members of the class to calculate some stuff. So for each class
I have to rewrite the constructor/destructor initializers for memory
allocation, initializers of structures and data and so on...
So generally what you suggest is a nice way to do it but in
my case it doesn't work.
I DO NEED PARTIAL MEMBER TEMPLATE SPECIALIZATION
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Author: AlbertoBarbati@libero.it (Alberto Ganesh Barbati)
Date: Thu, 1 Dec 2005 06:01:56 GMT Raw View
dkouroun@cc.uoi.gr wrote:
> If it is not clear what do I mean by the term
> partial member template specialization
> here it is in action ...
>
> template<typename A, typename B, typename C>
> class MyClass
> {
> public:
> void f(const double x);
> };
>
> template<typename A, typename B, typename C> void
> MyClass<A, B, C>::f(const double x)
> {
> // do something with x in the general case
> }
>
> template<typename A, typename B>
> MyClass<A, B, double>::f(const double x)
> {
> // do something else with x in the case where
> // the template parameter C is double
> }
>
> C++ doesn't allow this at the moment. This is annoying.
> I have to write explicit specializations for all the cases
> A = ... and B = ... and C= ... .That means that if A can
> be 3 different types B also 3 different types and C 3 different
> types, I have to write explicit specializations for 3*3*3 = 27 cases.
C++ doesn't allow this and it's my understanding that it won't allow
this, ever. That's because you are missing the key point that, a priori,
classes MyClass<A,B,C> and MyClass<A,B,double> can be totally unrelated
classes. In particular, MyClass<A,B,double> might not even have an f()
member. In know that in your case, this doesn't happen, but the compiler
must be prepared to such eventuality, so when parsing
template<typename A, typename B>
MyClass<A, B, double>::f(const double x) { }
the compiler must require the definition of what MyClass<A, B, double>
to be available. But the general template alone is not enough, as the
programmer would still be allowed to specialize MyClass<A, B, double> at
a later time, so a matching specialization must already be present.
> This is unacceptable for a high level language as C++ and specially
> for templates which were created to allow high level abstractions.
It may be unacceptable for you, but the freedom in specializing classes
is a much better feature, IMHO, which unfortunately appears to be, as I
said before, incompatible with the possibility of specializing member
separately. If you can think about a way to have both worlds, I
encourage you to make a proposal.
BTW, there is a very simple alternative, and that is to forward the
implementation to overloaded function templates. For example:
template<typename A, typename B, typename C>
void f_impl(MyClass<A, B, C>& c, const double x) { ... }
template<typename A, typename B>
void f_impl(MyClass<A, B, double>& c, const double x) { ... }
template<typename A, typename B, typename C> void
MyClass<A, B, C>::f(const double x)
{
f_impl(*this, x);
}
Not the best thing you might think of (f_impl must use c to access
MyClass members and you have to be careful about private/protected
access) but at least it scales good enough.
HTH,
Ganesh
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Author: "Bob Bell" <belvis@pacbell.net>
Date: Thu, 1 Dec 2005 22:13:45 CST Raw View
dkouroun@cc.uoi.gr wrote:
> >> there. Then for each specialized class I have to rewrite them
> >> again and again and again.
>
> >Not necessary. Since that functionality doesn't depend on specializations it
> >should be refactored into a separate class template.
>
> It is necessary because in my case those functions use data
> members of the class to calculate some stuff. So for each class
> I have to rewrite the constructor/destructor initializers for memory
> allocation, initializers of structures and data and so on...
>
> So generally what you suggest is a nice way to do it but in
> my case it doesn't work.
>
> I DO NEED PARTIAL MEMBER TEMPLATE SPECIALIZATION
Maybe you do, but shouting won't convince anyone. In any case, I'm
certainly not convinced. Factor out the stuff that needs to be
partially specialized into its own class the way Greg and Gene said,
then any data of the original class that needs to be operated on by the
factored class can be passed as function arguments.
Bob
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Author: dkouroun@cc.uoi.gr
Date: Thu, 1 Dec 2005 23:27:28 CST Raw View
Dear Alberto,
thanks very much for the feedback.
I see, you do have a point there! But the problem is that
usually, one has to decide which kind of implementation
(specializing classes, or specializing class members)
to use, depending on his problem. There are cases where
specializing template classes is the natural and more
convenient way to go, but there are also cases, like
mine, where specializing member functions of template
classes, is the best, more convenient and more maintainable
way to go, since it leads to much sorter code.
I do not have this alternative though, as you said, because C++
prefers to support class specializations. To this end, one has to think
how to support both. I do not know if this is easy to be implemented by
compiler vendors, but the compiler could just check out if there
is any specialized version of the class. If not then it should search
for
partially specialized members. If both class partial specialization
and partial member template specializations exist, then and only
then, it should issue an error. If on the other hand no partial member
template specializations are requested then it can go on as usual
specializing classes.
Do you think this is too hard to be implemented by compiler vendors?
As it concerns the workaround you suggest I have already
used this in a lot of codes to circumvent this annoying restriction
of partial member template specialization, as Andrei Alexandrescu
suggests in his book. It works fine, and it is the only way round,
with no performance penalty at all if the functions can be inlined.
The truth though is that I do not like it at all, because it is not
the straight way to go and it is not handy. When the only reasonable
thing is to use "Partial Member Template Specialization" then
everything else makes you unhappy but I realize that there is not
any better way to go.
Now as it concerns our discussion above about whether or
not C++ should ever support the partial member template
specializations I think you should remember that partial
function template specializations are also not allowed.
Do you think there is any good reason for that too?
To sum up, C++ unfortunately supports
"partial template specializations"
only for classes which throws out function
templates and class members.
A proposal about supporting that features
should be seriously considered here because
those lacking features can result in much better
code quality and maintainability which is the main
reason after all, one uses templates and high
level languages like C++.
Thanks for the feedback once again!
Drosos.
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Author: "thoth39" <pedro.lamarao@gmail.com>
Date: Fri, 2 Dec 2005 19:34:31 CST Raw View
What should the compiler do with the following?
template<typename A, typename B, typename C>
class MyClass
{
public:
void f(const double x);
};
template<typename A, typename B, typename C> void
MyClass<A, B, C>::f(const double x)
{
// do something with x in the general case
}
template<typename A, typename B>
MyClass<A, B, double>::f(const double x)
{
// do something else with x in the case where
// the template parameter C is double
}
// MyClass partial specialization does not declare a member function f
template<typename A, typename B>
class MyClass<A, B, double>
{
public:
void g();
};
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Author: dkouroun@cc.uoi.gr
Date: Fri, 2 Dec 2005 19:37:49 CST Raw View
> Maybe you do, but shouting won't convince anyone. In any case, I'm
> certainly not convinced. Factor out the stuff that needs to be
> partially specialized into its own class the way Greg and Gene said,
> then any data of the original class that needs to be operated on by the
> factored class can be passed as function arguments.
>
> Bob
No Way! It is much more trouble than specializing explicitly
for all the template parameters. You see each class has been
designed to serve a specific purpose. We cannot play around
with classes to give to C++ something it can digest.
What I have done to overcome the problem is to use member
overloading as Andrei Alexandrescu suggest in his book.
So I have the following light way class:
template <typename A, typename B>
class Type2Type
{
};
and I have rewritten my class members such that they
take one argument of Type2Type by value.
So I have a template member function lets say caller:
template<typename C, typename D>
class MyClass
{
public:
template<typename A, typename B> void
caller(const int i)
{
f(Type2Type<A, B>(), i);
}
void f(Type2Type<double, int> tt, const int i);
void f(Type2Type<double, char> tt, const int i);
// and all the rest versions needed
};
Since C++ doesn't allow partial specializations
of the member functions according to the template
parameters A or B I have no other way round.
I hope someday C++ committee will understand this
restriction and will do something about it. At the moment
I have to live with many annoying tricks like this one
which also gives a lot of warnings: "unused variable tt"
Anyway guys,
I posted this issue here not to get some help on
what should I do but to see if there are any other
people out there who share the same thoughts
about partial member template specialization
and partial function specializations. I see that this
has been missunderstood.
I would like to hear if there are some of you who
would love to see the aforementioned features
implemented by C++ compilers some day maybe in the
near future ...
Cheers,
Drosos.
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Author: AlbertoBarbati@libero.it (Alberto Ganesh Barbati)
Date: Sat, 3 Dec 2005 01:51:12 GMT Raw View
Dear Drosos,
first of all I would like to point out a mistake in the terminology you
are using. In this code
template <typename T>
class A
{
void foo();
};
class B
{
template <typename T> void foo();
};
B::foo is a member template while A::foo is *not*. A::foo is a
(non-template) member of a class template. Please, don't think I'm just
picky, it makes a whole lot of difference! So when you write:
template<typename A, typename B>
MyClass<A, B, double>::f(const double x)
{...}
you are *not* providing a specialization of a member template, but you
are providing the definition of a member of a specialization of a class
template. This way of looking at the issue gives more insights about why
you first need to specialize the class template, before you can define
its (non-template) members.
> I do not have this alternative though, as you said, because C++
> prefers to support class specializations. To this end, one has to think
> how to support both. I do not know if this is easy to be implemented by
> compiler vendors, but the compiler could just check out if there
> is any specialized version of the class. If not then it should search
> for
> partially specialized members. If both class partial specialization
> and partial member template specializations exist, then and only
> then, it should issue an error. If on the other hand no partial member
> template specializations are requested then it can go on as usual
> specializing classes.
I'm not a compiler expert, but I feel that this approach doesn't fit
well with the C++ compiler/linker model. A better approach could be that
as soon the compiler encounters this definition
template<typename A, typename B>
MyClass<A, B, double>::f(const double x)
{...}
unless an explicit specialization of MyClass<A,B,double> has been given
or the template has already been instantiated, the compiler should
immediately specialize MyClass<A,B,double> from the generic template.
However, I have the feeling that even this solution have pitfalls that I
can't see right now.
> Do you think this is too hard to be implemented by compiler vendors?
Yes, I think so. But, I repeat, I'm no compiler expert.
> Now as it concerns our discussion above about whether or
> not C++ should ever support the partial member template
> specializations I think you should remember that partial
> function template specializations are also not allowed.
> Do you think there is any good reason for that too?
Function templates are a completely different matter. Remember my
preamble: your problem is about members of class templates, not member
(function) templates! Accoding to Vandevoorde-Josuttis' book, partial
specializiation of function templates is under investigation for
inclusion in the standard, but I'm not actively following the commitee
work in this area so I don't much more. I someone has more info about
this point, please intervene, now I am curious too...
Regards,
Ganesh
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Author: darkknight.21@gmail.com (darkknight)
Date: Sat, 3 Dec 2005 22:14:52 GMT Raw View
On Thu, 1 Dec 2005 06:01:56 GMT, Alberto Ganesh Barbati wrote:
>
>BTW, there is a very simple alternative, and that is to forward the
>implementation to overloaded function templates. For example:
>
>template<typename A, typename B, typename C>
>void f_impl(MyClass<A, B, C>& c, const double x) { ... }
>
>template<typename A, typename B>
>void f_impl(MyClass<A, B, double>& c, const double x) { ... }
>
>template<typename A, typename B, typename C> void
>MyClass<A, B, C>::f(const double x)
>{
> f_impl(*this, x);
>}
>
>Not the best thing you might think of (f_impl must use c to access
>MyClass members and you have to be careful about private/protected
>access) but at least it scales good enough.
They can also be made overloaded template member functions of MyClass of
which only one is used for any particular instantiation of MyClass. A
slight drawback of this mechanism over a language level solution is the
extra parameter that's passed to f_impl and possibly issues to do with
explicit instantiation of the class. You could declare the first
parameter of f_impl as un-named pointer and not dereference "this" in
the call.
The solution wanted by the OP was
template<typename A, typename B, typename C> void
MyClass<A, B, C>::f(const double x)
{
// do something with x in the general case
}
template<typename A, typename B>
MyClass<A, B, double>::f(const double x)
{
// do something else with x in the case where
// the template parameter C is double
}
which implies that the second of the two functions could be used by
multiple specialisations of MyClass e.g. MyClass<A,int,double> ,
MyClass<A,char,double> etc. The member template function workaround
requires each of the class specialisations to include their own f_impl
function(s) - but they would possibly only need one, with one less in
the primary class template. OTOH the non member template function
workaround requires friend declarations if you want access to private
members. It's a pretty effective workaround though.
There's also the overloading versus specialization issue to watch out
for as described here http://www.gotw.ca/publications/mill17.htm
Graeme
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Author: "Bob Bell" <belvis@pacbell.net>
Date: Sat, 3 Dec 2005 16:15:39 CST Raw View
dkouroun@cc.uoi.gr wrote:
> > Maybe you do, but shouting won't convince anyone. In any case, I'm
> > certainly not convinced. Factor out the stuff that needs to be
> > partially specialized into its own class the way Greg and Gene said,
> > then any data of the original class that needs to be operated on by the
> > factored class can be passed as function arguments.
> >
> > Bob
>
> No Way! It is much more trouble than specializing explicitly
> for all the template parameters. You see each class has been
> designed to serve a specific purpose. We cannot play around
> with classes to give to C++ something it can digest.
Suit yourself. You can write the function you want once as a member of
a template, or you can explicitly specialize the function 3 * 4 * 2
times. For me the advantages of writing the function once far outweigh
any reluctance I have to add a new class.
Frankly, I don't understand why you would reject this suggestion on the
basis of not wanting to create an artificial class, then go on to
describe your own workaround which involves creating an artificial
class.
[snip]
> Anyway guys,
> I posted this issue here not to get some help on
> what should I do but to see if there are any other
> people out there who share the same thoughts
> about partial member template specialization
> and partial function specializations. I see that this
> has been missunderstood.
Frankly, you sounded like you were in pain, having to write all those
nearly identical specializations. I don't think it's so bad that people
have tried to help you come up with a solution that works today, as
opposed to discussing a solution that will take years if it ever comes
at all.
> I would like to hear if there are some of you who
> would love to see the aforementioned features
> implemented by C++ compilers some day maybe in the
> near future ...
I for one have never needed this feature; in cases where I've needed
something like this, the use of extra implementation class templates
works fine for me. Perhaps you should try it out before deciding that
the best solution is a change to the language.
Bob
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Author: dkouroun@cc.uoi.gr
Date: Sat, 3 Dec 2005 16:13:46 CST Raw View
Dear Alberto,
thank you once again for your extensive reply!
I really appreciate. So as it concerns my erroneus
terminology I agree with you. It might be misleading.
Basically I mean both. Both template members of
a template class and non-template members of
template classes. Since C++ doesn't allow any
partial template specializations of either of those
unless they are explicit according to all the template
arguments of the class and/or the member.
>unless an explicit specialization of MyClass<A,B,double> has been given
>or the template has already been instantiated, the compiler should
I do not see what is the difference of your suggestion above
with the one I have given before. This is exactly what I meant
and I apologize if it was not so clear. So this gives and answer
to our friends "thoth39" question once more.
I am not a compiler expert myself but I do not think that
implementing such a thing would be a problem for those
guys. They are excellent programmers all of them and
there is one simple decision to be made here from the
compiler.
1. Search for a partially specialized version of the class.
2. Search for partially specialized member functions of the class.
3. if both exist the issue an error.
4. if only specialized members are found then instantiate the generic
template of the class.
5. if only partially specialized versions of the class are found then
proceed as usual.
thanks once again for the feedback.
cheers,
Drosos.
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]