Template meta programming problem with g++

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

This code compiles on MSVC but not on G++ :

==================================

template<int I>
class B
{
public:
	static void SomeMethod()
	{
		A::SomeMethod();
	}
};

class A
{
public:
	static void SomeMethod();
};

void test()
{
	B<3>::SomeMethod();
}


==================================

The error with g++ is :
test.cpp: In static member function "static void B<I>::SomeMethod()":
test.cpp:7:3: error: "A" has not been declared

Is there is a option to indicate to g++ to evaluate the template
functions only when a specialization is called, and not before ?

Thank you very much !




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux