OVH Cloud OVH Cloud

List Parameters

1 réponse
Avatar
user
Hi,

I try this code:

template <typename T> inline
T const& max(T const& a, T const& b)
{
return a<b?b:a;
}

template <typename T, ... list> inline
T const& max(T const& a, T const& b, list const& x)
{
return max(a, max(b, x));
}


But it not compile.
I have this message:
"error: expected identifier before '...' token"

I saw this sample in book "c++ templates: the complete guide"
i use wxWidgets with gcc compiler.

Is this code legal? is it compile?
If no how use list parameters in template?

Thunks

1 réponse

Avatar
Jean-Marc Bourguet
writes:

I saw this sample in book "c++ templates: the complete guide" i use
wxWidgets with gcc compiler.


Dans unc chapitre intitulé "Future Directions" qui décrit des extensions
possibles.

Is this code legal?


Pour le moment, ce n'est pas conforme.

A+

--
Jean-Marc
FAQ de fclc++: http://www.cmla.ens-cachan.fr/~dosreis/C++/FAQ
C++ FAQ Lite en VF: http://www.ifrance.com/jlecomte/c++/c++-faq-lite/index.html
Site de usenet-fr: http://www.usenet-fr.news.eu.org