
5 Oct
2006
5 Oct
'06
9:37 a.m.
----Original Message---- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of Frank Birbacher Sent: 05 October 2006 10:00 To: boost@lists.boost.org Subject: Re: [boost] Geometry/Vector Lib > Hi! > > Jason Hise schrieb: >> vec[0] = 42; >> vec[_x] = 42; // does the same thing > > "_x" is not allowed as a variable name. Yes it is. 17.4.3.1.2 [lib.global.names] in the standard says: - Each name that contains a double underscore (_ _) or begins with an underscore followed by an uppercase letter (2.11) is reserved to the implementation for any use. - Each name that begins with an underscore is reserved to the implementation for use as a name in the global namespace. _x is legal if it is defined in (eg) boost::geometry and brought in via a using statement. The real problem is that leading _ is a fairly common convention for "member variable", and as you mention below, a member named 'x' in a mathematical context is not inconceivable! -- Martin Bonner Martin.Bonner@Pitechnology.com Pi Technology, Milton Hall, Ely Road, Milton, Cambridge, CB4 6WZ, ENGLAND Tel: +44 (0)1223 203894