Initialization of a local static variable with a member

Luke kazade at gmail.com
Sun Nov 11 00:56:29 PST 2007


Hi all,

I've just started learning D (I've been programming C++ for 7 years). While I was converting some old C++ code to D I've stumbled across this problem:

	float GetFPS(uint elapsedFrames = 1) {
		static LARGE_INTEGER s_lastTime = m_startTime; //< this line

This gives "ERROR: non-constant expression this.m_startTime". Is there any way to avoid this error?





More information about the Digitalmars-d mailing list