Description

User-defined attribute convenience functions

Package Information

Version0.3.0 (2016-Nov-09)
Homepagehttps://github.com/msoucy/painlesstraits
Repositoryhttps://github.com/msoucy/painlesstraits
LicenseBSL-1.0
CopyrightCopyright © 2014-2015, Edwin van Leeuwen
AuthorsEdwin van Leeuwen, Pierre Krafft, Matt Soucy
Registered byMatt Soucy
Dependenciesnone

Installation

To use this package, put the following dependency into your project's dependencies section:

dub.json
dub.sdl

Readme

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

Available versions

0.3.0 0.2.0 0.1.0 0.0.3 0.0.2 0.0.1 ~master