painlesstraits 0.3.0

User-defined attribute convenience functions


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:

painlesstraits

Build Status Coverage Status

This module provides a few helper templates to make working with dlang's User Defined Attributes just a bit nicer.

Inspired and derived from templates found in the painlessjson project.

import painlesstraits;

struct SomeContainer
{
	int a;
	string b;
	long c;

	string name() @property
	{
		return "SomeContainer." ~ b;
	}

	string someFunction()
	{
		return "Foo";
	}
}

pragma(msg, allPublicFieldsOrProperties!SomeContainer); // tuple("a", "b", "c", "name")
pragma(msg, allPublicFields!SomeContainer); // tuple("a", "b", "c")

// and much more
Authors:
  • Edwin van Leeuwen
  • Pierre Krafft
  • Matt Soucy
Dependencies:
none
Versions:
0.3.0 2016-Nov-09
0.2.0 2016-Apr-12
0.1.0 2016-Jan-20
0.0.3 2015-Nov-06
0.0.2 2015-Oct-31
Show all 7 versions
Download Stats:
  • 55 downloads today

  • 396 downloads this week

  • 942 downloads this month

  • 216634 downloads total

Score:
3.8
Short URL:
painlesstraits.dub.pm