List Parameters



 DEVELOP > c-Plus-Plus > List Parameters

LINK TO THIS PAGE  


rating :  0   |  0


  Page 1 of 1
Topic: DEVELOP > c-Plus-Plus
User: ""
Date: 21 Oct 2006 07:11:49 PM
Object: List Parameters
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
.

 

NEWER

pg.1232     pg.940     pg.716     pg.544     pg.412     pg.311     pg.234     pg.175     pg.130     pg.96     pg.70     pg.50     pg.35     pg.24     pg.16     pg.10     pg.6     pg.3     pg.1

OLDER