E
eiji
Does that just not compile with vc++?
I found this in "template complete" and asked myself if this is just a
nice feature of some compilers, or if it is standard?
I can't install other compilers!
###########
#include <iostream>
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));
}
int main(int argc, char* argv[])
{
std::cout << max<double>(1.0, 3.0 ,4.0 ,8.0 ,0.0) << std::endl;
system("PAUSE");
return 0;
}
I found this in "template complete" and asked myself if this is just a
nice feature of some compilers, or if it is standard?
I can't install other compilers!
###########
#include <iostream>
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));
}
int main(int argc, char* argv[])
{
std::cout << max<double>(1.0, 3.0 ,4.0 ,8.0 ,0.0) << std::endl;
system("PAUSE");
return 0;
}