Implement formatting for enums

This commit is contained in:
2018-02-01 16:29:13 +01:00
parent 048ddf21ff
commit cbc68c2c43
2 changed files with 36 additions and 1 deletions

View File

@@ -308,6 +308,17 @@ enum bool isClass(T) = is(T == class);
*/
enum bool isStruct(T) = is(T == struct);
/**
* Tests whether $(D_PARAM T) is a enum.
*
* Params:
* T = A type.
*
* Returns: $(D_KEYWORD true) if $(D_PARAM T) is an enum,
* $(D_KEYWORD false) otherwise.
*/
enum bool isEnum(T) = is(T == enum);
/**
* Determines whether $(D_PARAM T) is a polymorphic type, i.e. a
* $(D_KEYWORD class) or an $(D_KEYWORD interface).