TITLE: local types and template parameters (Source: comp.lang.c++.moderated, 6 Oct 2000) BARES: Jan Bares > Can someone tell me if this is correct (according to ANSI), > and if not, what is the reason? The code is just ilustrative. > > template > T ReturnMe(T t) {return t;} > > void Test() > { > struct SomeS > { > int i; > }; > > SomeS s; > > s = ReturnMe(s); > } COMEAU: comeau@panix.com (Greg Comeau) Comeau C/C++ 4.2.44 (Sep 30 2000 11:56:08) for _MS_WINDOWS_x86_BETA3 Copyright 1988-2000 Comeau Computing. All rights reserved. "LT.C", line 14: error: a template argument may not reference a local type s = ReturnMe(s); ^ Of which ANSI agrees. Why? A different example might help address that: http://www.comeaucomputing.com/techtalk/templates/#stringliteral _______________________________________________ cpptips mailing list http://cpptips.hyperformix.com