Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: VC++6.0 - int template parameter

Author: David Rasmussen

Date: 12:45:38 02/22/03

Go up one level in this thread


On February 22, 2003 at 15:22:06, Steffen Jakob wrote:

>I ported Hossa to MS Windows. I noticed a difference in the searched nodes
>between the linux version and the windows version. I use my own pseudo-random
>number generator. Therefore the behaviour should be deterministic and not depend
>on the used platform. After some debugging i found out that VC++6.0 seems to
>have problem with int template parameters which I use a lot. Look at the
>following example:
>
>// --------------------------------------------------
>#include <iostream>
>
>template <int S> inline void foo() {
>	std::cout << "S=" << S << std::endl;
>}
>
>int main(int argc, char **argv) {
>	foo<4>();
>	foo<10>();
>
>	return 0;
>}
>// --------------------------------------------------
>
>
>Here VC++6.0's output is
>
>S=10
>S=10
>
>while g++3.2 correctly says
>
>S=4
>S=10
>
>
>Is this a known bug?
>

MSVC 6 has a _lot_ of compliance issues, and most of them are about templates.
But MSVC 6 doesn't even handle for (int i = 0 ...) correctly. The int i is
visible in the enclosing scope after the loop, which is incorrect.

MSVC 7 (.NET) corrects a lot of these. I am not at home, so I can't check your
example. Also, Intel C++ 7 is even more compliant, although it also have some
issues.

/David




This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.