This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
One thing I often find annoying in C++ is that you can't have virtual static functions (a function that can be selected using an object's virtual function table but then doesn't take that object as an implicit "this" parameter).struct some_base { virtual int id () = 0; }; struct bar : some_base { int id () { return 1; } }; void foo (int id) { } #define REG(aa) foo(((aa*)0L)->aa::id())
is that code harmless from your viewpoint? actually, how come the code emitted works at all? :)
for you perhaps it's evident, but being an user i have to rely on standard.If you need to rely on the standard, I expect you need to throw out the whole mess of code and rewrite from scratch with a decent design. I assume you don't have time to do that. Welcome to the real world and sorry the standard couldn't make that journey with you.
if standard says that's an undefined or implementation defined behaviour than
i'd rather kick this code out.
you mean "does not violate" from the viewpoint of optimizer, do you?
and what if you later take address of the returned reference from GetVector3()
and work with that, still ok?
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |