concepts 0.0.4

Concepts for D

To use this package, run the following command in your project's root directory:

Manual usage
Put the following dependency into your project's dependences section:

Concepts for D

Build Status

Right now there's only models, which can be used as a UDA or in a static assert:

    void checkFoo(T)()
        T t = T.init;;

    enum isFoo(T) = is(typeof(checkFoo!T));

    @models!(Foo, isFoo) //as a UDA
    struct Foo
        void foo() {}
        static assert(models!(Foo, isFoo)); //as a static assert

Here a template constraint isFoo is guaranteed to be true for type Foo. The difference between this and a regular static assert is that when the predicate fails the code for checkFoo is instantiated anyway so that the user knows why it failed to compile.

  • Atila Neves
0.0.8 2018-Nov-11
0.0.7 2017-Sep-02
0.0.6 2017-May-04
0.0.5 2017-Apr-07
0.0.4 2017-Feb-16
Show all 9 versions
Download Stats:
  • 2 downloads today

  • 62 downloads this week

  • 329 downloads this month

  • 49586 downloads total

Short URL: