Optional parameters referring to previous parameters?
Andrej Mitrovic
andrej.mitrovich at gmail.com
Thu May 10 07:48:28 PDT 2012
On 5/10/12, Mehrdad <wfunction at hotmail.com> wrote:
> Is this possible/should it compile?
>
> If not, should I make an enhancement request for it? It's been
> something that would've been useful in a ton of situations for
> me...
>
> void process(R)(R items, size_t maxCount = items.length)
> {
> }
>
If this is implemented I'd also throw this in:
struct Foo
{
@property int x() { return 1; }
void process(size_t y = x) { }
}
It doesn't have to be a property function, it could be a field. But it
won't work right now unless "x" is marked static.
More information about the Digitalmars-d
mailing list