Incorrect (?) template specialization results when compiling with -O3

Adam McLaurin gcc@irotas.net
Fri Jul 10 18:59:00 GMT 2009


Yeah, this is how I've rewritten it and now it's working as I expect. It
even works in Borland (amazingly).

Sometimes I think that every feature of C++ is somehow surprising when
you first try to use it. Ah well, that's why I get paid!

Thanks again,
Adam


On Fri, 10 Jul 2009 10:20 -0400, "John Fine" <johnsfine@verizon.net>
wrote:
> Or distribute the declarations the opposite way to create the opposite 
> (but more easily non circular) dependency:
> 
> Put the line
> template<> const char* getstring<foo::bar>();
> 
> In the header that defines foo and declares (and maybe defines) bar,
> rather than in a header dedicated to getstring.



More information about the Gcc-help mailing list