`ref T` should be a type!!
Walter Bright
newshound2 at digitalmars.com
Mon Apr 1 20:51:44 UTC 2019
On 4/1/2019 1:00 PM, Rubn wrote:
> Arrays in C++ are just pointers.
No, they're not.
> If you can't have a pointer to something, it is
> only natural you can't have array either.
g++ -c test.cpp
test.cpp: In function void test():
test.cpp:1:24: error: declaration of p as array of references
void test() { int& p[3]; }
^
As I said, C++ ref can only appear at the top of an AST, which is what a
"storage class" is.
C++ tries to have it be both a floor wax and a desert topping, making for a
device that nobody understands. Be careful what you wish for.
More information about the Digitalmars-d
mailing list