incubator-stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Sebor <se...@roguewave.com>
Subject Re: openSUSE 10.2 -- gcc 4.1.1/2 -- valarray
Date Sun, 18 Mar 2007 19:54:47 GMT
Scott Zhong wrote:
> do you suggest we do this to valarray?
> 
> cat t.cpp && gcc -v && gcc t.cpp && ./a.out
> class _slice

std::slice et al are required by the standard. I was referring
to the get_slice() member function which isn't. A program that
does

     #define slice !ERROR!
     #include <valarray>

is ill-formed, but a program that does

     #define get_slice !ERROR!
     #include <valarray>

is not.

> {
> public:
>         _slice () : a(0), b(0), c(0) { }
>         _slice (int _a, int _b, int _c) 

Names with a single leading underscore followed by a lowercase
letter are reserved for use as global names, so while that alone
prevents programs from #defining macros that look like that it
doesn't make such names reserved to the implementation. I don't
think there's a way to detect local variables that are in
violation of this requirement. Nevertheless, the convention
for local variables is two leading underscores, i.e., __a,
__b, and __c above.

Martin


Mime
View raw message