Template meta programming problem with g++

John Fine johnsfine@verizon.net
Sun Jul 21 05:19:00 GMT 2013

The C++ standard is very specific on which names in a template 
definition are bound when that definition is initially parsed vs. which 
are bound only after the template parameters are given.

You are asking for the compiler to violate those rules.

I expect gcc has no such option.  I'm not 100% certain it has no such 
option, but if there were such an option, I would advise against using it.

When MSVC compiles incorrect code, that is not a good justification for 
leaving your code incorrect.

Aurélien FILEZ wrote:
> This code compiles on MSVC but not on G++ :
> ...
> Is there is a option to indicate to g++ to evaluate the template
> functions only when a specialization is called, and not before ?

More information about the Gcc-help mailing list