Computer Chess Club Archives


Search

Terms

Messages

Subject: VC++6.0 - int template parameter

Author: Steffen Jakob

Date: 12:22:06 02/22/03


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?

Greetings,
Steffen.



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.