quack 0.4.0
A compile-time duck typing library 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:
quack
A library for enabling compile-time duck typing in D.
Duck Typing
Duck typing is a reference to the phrase "if it walks like a duck, and quacks like a duck, then it's probably a duck." The idea is that if a struct
or class
has all the same members as another, it should be usable as the other.
Examples
import quack;
struct A
{
int x;
}
struct B
{
A a;
alias a this;
}
void someFunction( T )( T t ) if( extends!( T, A ) )
{
}
void main()
{
B b;
someFunction( b );
}
- Registered by Colden Cullen
- 0.4.0 released 10 years ago
- ColdenCullen/quack
- MIT
- Copyright © 2014, Colden Cullen
- Authors:
- Dependencies:
- tested
- Versions:
-
1.0.0 2014-Aug-16 0.4.0 2014-Aug-03 0.3.0 2014-Aug-02 0.2.0 2014-Aug-02 0.1.0 2014-Aug-01 - Download Stats:
-
-
0 downloads today
-
0 downloads this week
-
0 downloads this month
-
263 downloads total
-
- Score:
- 0.8
- Short URL:
- quack.dub.pm