On Wednesday, 30 December 2020 at 20:42:49 UTC, jmh530 wrote:
You mean like this

struct Foo(T)
{
    T x;
}

void foo(T : Foo!V, V)(T x) {


Not quite, "Foo" would be a template parameter, so something like this (which does not work, but maybe there is some other way to express it?):


struct Foo(T)
{
    T x;
}


void foo(T)(T!int x) {
    import std.stdio: writeln;
    writeln("here");
}

void main() {
    Foo!int x;
    foo(x);
}




  • Re: C++ or D? Imperatorn via Digitalmars-d-learn
    • Re: C++ or D? Rekel via Digitalmars-d-learn
      • Re: C++ or D? Ola Fosheim Grøstad via Digitalmars-d-learn
        • Re: C++ or D? sighoya via Digitalmars-d-learn
          • Re: C++ or D... Ola Fosheim Grøstad via Digitalmars-d-learn
            • Re: C++... sighoya via Digitalmars-d-learn
              • Re:... Ola Fosheim Grøstad via Digitalmars-d-learn
              • Re:... jmh530 via Digitalmars-d-learn
              • Re:... Ola Fosheim Grøstad via Digitalmars-d-learn
              • Re:... sighoya via Digitalmars-d-learn
              • Re:... Ola Fosheim Grøstad via Digitalmars-d-learn

Reply via email to