I've found out that on g++ the following code compiles:
1 2 3 4
struct Foo
{
****const****const****& Foo() {}
};
I can put as many * and const as I want and one & at the end.
When it compiles it g++ gives the warning "control reaches end of non-void function" as it would with normal functions.
If I return something it will give the error expected when returning a value from the constructor.
Why does g++ allow this kind of declaration for a constructor?
Comeau C/C++ 4.3.10.1 (Oct 6 2008 11:28:09) for ONLINE_EVALUATION_BETA2
Copyright 1988-2008 Comeau Computing. All rights reserved.
MODE:strict errors C++ C++0x_extensions
# g++ --version
g++ (GCC) 3.3.3 20040412 (Red Hat Linux 3.3.3-7)
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Are you some sort of insane quality control specialist? (The kind of person that makes sure programs that ask for a number in '1'..'5' don't break when the user types 'quit', but to the (N+1)th degree?)
I like playing with things ( until I eventually break them... )
So I'm the kind of user who if the program asks to enter 1...5 tries with ROTFLMAOMGWTFBBQLOL123456789ABCDEF
In this way I find interesting features but at the same time I get a lot of bugs...