diff options
| author | Eugen Wissner <belka@caraus.de> | 2016-12-22 22:05:06 +0100 |
|---|---|---|
| committer | Eugen Wissner <belka@caraus.de> | 2016-12-22 22:05:06 +0100 |
| commit | 28755b4d0196f64528dde54514405f4fe3dc1314 (patch) | |
| tree | 6806e542bc8312e7d45db331ba432fc71041777e | |
| parent | 8bd6a149882b44c3450428df36f904f8714ea044 (diff) | |
| download | tanya-28755b4d0196f64528dde54514405f4fe3dc1314.tar.gz | |
Rename module traits into enums
| -rw-r--r-- | source/tanya/enums.d (renamed from source/tanya/traits.d) | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/source/tanya/traits.d b/source/tanya/enums.d index 3f7dfcf..8fdbf8d 100644 --- a/source/tanya/traits.d +++ b/source/tanya/enums.d @@ -3,25 +3,16 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /** + * Generic enum templates. + * * Copyright: Eugene Wissner 2016. * License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/, * Mozilla Public License, v. 2.0). * Authors: $(LINK2 mailto:belka@caraus.de, Eugene Wissner) */ -module tanya.traits; +module tanya.enums; import std.traits; -import std.meta; - -/** - * Params: - * T = Type. - * - * Returns: $(D_KEYWORD true) if $(D_PARAM T) is a reference type or a pointer, - * $(D_KEYWORD false) otherwise. - */ -enum bool isReference(T) = isDynamicArray!T || isPointer!T - || is(T == class) || is(T == interface); /** * Initializer list. @@ -35,7 +26,7 @@ enum bool isReference(T) = isDynamicArray!T || isPointer!T * Args = Argument type. * args = Arguments. */ -static enum IL(Args...)(Args args) +enum IL(Args...)(Args args) if (Args.length > 0) { alias BaseType = typeof(args[0]); @@ -54,4 +45,5 @@ static enum IL(Args...)(Args args) unittest { static assert(IL(1, 5, 8).length == 3); + static assert(IL(1, 5, 8).sizeof == 3 * int.sizeof); } |
