summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2017-01-03 10:03:28 +0100
committerEugen Wissner <belka@caraus.de>2017-01-03 10:03:28 +0100
commitb8d5d4c2bd1e8b9637782b36b8ccbafd2785070e (patch)
treee92168e8e8c04f46d9bcfc95312cb3922434c3b9
parentb6413823cdf470e6b3dcf75ee59cfc97aff33825 (diff)
downloadtanya-b8d5d4c2bd1e8b9637782b36b8ccbafd2785070e.tar.gz
Fix template condition for Vector.insertBack
-rw-r--r--source/tanya/container/vector.d8
-rw-r--r--source/tanya/meta/gen.d (renamed from source/tanya/enums.d)6
-rw-r--r--source/tanya/meta/package.d15
3 files changed, 21 insertions, 8 deletions
diff --git a/source/tanya/container/vector.d b/source/tanya/container/vector.d
index ac26d43..0e67b54 100644
--- a/source/tanya/container/vector.d
+++ b/source/tanya/container/vector.d
@@ -15,8 +15,9 @@ import core.exception;
import std.algorithm.comparison;
import std.conv;
import std.range.primitives;
+import std.meta;
import std.traits;
-public import tanya.enums : IL;
+public import tanya.meta.gen : IL;
import tanya.memory;
version (unittest)
@@ -631,9 +632,6 @@ struct Vector(T)
return toRemove;
}
- /// Ditto.
- alias remove = removeBack;
-
///
unittest
{
@@ -655,7 +653,7 @@ struct Vector(T)
* Returns: The number of elements inserted.
*/
size_t insertBack(R...)(auto ref R el) @trusted
- if (isImplicitlyConvertible!(R[0], T))
+ if (allSatisfy!(ApplyRight!(isImplicitlyConvertible, T), R))
{
reserve(length_ + el.length);
if (capacity_ <= length_)
diff --git a/source/tanya/enums.d b/source/tanya/meta/gen.d
index 8fdbf8d..a87a90b 100644
--- a/source/tanya/enums.d
+++ b/source/tanya/meta/gen.d
@@ -3,14 +3,14 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/**
- * Generic enum templates.
+ * Templates that generate values.
*
* 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)
+ * Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner)
*/
-module tanya.enums;
+module tanya.meta.gen;
import std.traits;
diff --git a/source/tanya/meta/package.d b/source/tanya/meta/package.d
new file mode 100644
index 0000000..c511220
--- /dev/null
+++ b/source/tanya/meta/package.d
@@ -0,0 +1,15 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+/**
+ * Metaprogramming.
+ *
+ * Copyright: Eugene Wissner 2016.
+ * License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/,
+ * Mozilla Public License, v. 2.0).
+ * Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner)
+ */
+module tanya.meta;
+
+public import tanya.meta.gen;