Boost logo

Boost Users :

From: Eric Niebler (eric_at_[hidden])
Date: 2005-05-12 12:12:47

Sliwa, Przemyslaw (London) wrote:
> Thanks for help,
> I have an additional question. Does anyone know why the following
> program gives different output on VC++ 6 and VC++ 2003 NET? It is pretty
> strange, isn't it?

VC6 is pretty strange, I agree. In particular, it doesn't handle
functions with non-type template parameters well. The following code
should demonstrate the problem. (Hopefully I'm remembering the problem
correctly -- I don't have VC6 installed on this machine.)

template<int I> void foo() { std::cout << I << '\n'; }

int main() {
   return 0;

If you must use VC6, avoid non-type template parameters for function

Eric Niebler
Boost Consulting

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at