bolts 0.3.0
Utility library for meta programming
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:
Bolts Meta Poragmming Utility Library
Full API docs available here
Bolts is a utility library for the D programming language that provides templates and compile time functions that are not available in D's std.traits and/or std.meta packages.
E.g.
struct S {
void f() {}
static void sf() {}
@property int rp() { return m; }
@property void wp(int) {}
}
// Check if something is a property
static assert( hasProperty!(S, "rp"));
// Check if a range is sprted
static assert(!isSortedRange!S);
// Get a list of member functions
static assert(memberFunctions!S == ["f", "sf"]);
// Check properties of a member funciton
static assert(hasMember!(S, "f).withProtection!"public");
// Provides some meta capabilities as wel...
alias R1 = typeof([1, 2, 3].filter!"true");
alias R2 = typeof([1.0, 2.0, 3.0]);
static assert(is(FlattenRanges!(int, R1, R2) == AliasSeq!(int, int, double)));
static assert(is(TypesOf!("hello", 1, 2, 3.0, real) == AliasSeq!(string, int, int, double, real)));
- Registered by ali akhtarzada
- 0.3.0 released 6 years ago
- aliak00/bolts
- MIT
- Copyright © 2018, Ali Akhtarzada
- Authors:
- Dependencies:
- none
- Versions:
-
1.8.1 2020-Aug-17 1.8.0 2020-Jul-20 1.7.0 2020-Feb-20 1.6.0 2020-Feb-19 1.5.3 2020-Feb-18 - Download Stats:
-
-
14 downloads today
-
55 downloads this week
-
368 downloads this month
-
56188 downloads total
-
- Score:
- 4.1
- Short URL:
- bolts.dub.pm