Exactly Replicating a Function's Signature?
%u
wfunction at hotmail.com
Wed Jan 19 21:46:34 PST 2011
> ref(const(immutable(string)[])) ?
> That's crazy!
Did you mean ref(const(immutable(char)[]))?? :]
Haha... well it was just an idea on how to add the functionality, and like I
mentioned, even if it was fine for 'ref' and 'lazy', it wouldn't make any sense
for 'out' anyway, so I'd say screw my idea; forget it. :)
The trouble with mixin is that it doesn't work the way templates like
ParameterTypeTuple do, because if you dynamically generate the header then one of
these must be true:
1. You can mixin() it in a template in Phobos, but that won't work because any
data types not in the current (Phobos) module can't be referenced, which basically
erases this solution completely.
2. You can just return a string and have the user use mixin() every time, but
that's a very ugly and error-prone solution, since it would litter the user's code
with lots of mixin()s.
Hope that made sense... so my conclusion is that, with the current
language/compiler features, it's likely there's no workable solution for this
(although I'm happy to be proven wrong!!). :\
More information about the Digitalmars-d-learn
mailing list