Skip to content

msoucy/painlesstraits

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

UDA Manipulation Made Painless

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages