Hi!

I've never used delegates before etc. not really familiar with it.
I was trying something like this:

import std.stdio;
import std.regex;

bool lol(string name, string val)
{
    if (name == "lal")
        if (val[0..3] == "2124")
            return true;
    return false;
}

bool lal(string name, string val) { return false; }

void main()
{
    struct Filter
    {
private bool delegate(string, string)[] delFuncs; // array with functions :D

public void add(bool delegate(string, string) filter_func) {
            delFuncs ~= filter_func;
        }
    }

    auto x = Filter();
    x.add(&lol);
    x.add(&lal);

    writeln(x);
}

How can I make this work? Thank you :)

Reply via email to