Is this a bug? "ref" affects only first tuple element

Henning Hasemann hhasemann at web.de
Fri Aug 10 06:56:40 PDT 2007


Code is roughly like this (these lines are untested but you should get
the picture):

void foo(ref Tuple!(int, real, char[])) {
 // ...
}

This seems to be equivalent to the following:

void foo(ref int, real, char[]) {
 // ...
}

Note that the ref is only "applied" to the int. I dont know if this
behaviour is intended because combining ref with tuples is not
documented.

If it is intended and not going to change in 1.x (or if that is going to
take long), I would like to know if there is a way to get the desired
effect (ie. all types prefixed with "ref") without having to write a
CTFE-parser that does the job via string-manipulation.

Henning

-- 
GPG Public Key:
http://keyserver.ganneff.de:11371/pks/lookup?op=get&search=0xDDD6D36D41911851
Fingerprint: 344F 4072 F038 BB9E B35D  E6AB DDD6 D36D 4191 1851



More information about the Digitalmars-d mailing list