We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b6dfc14 commit 2b0c0ceCopy full SHA for 2b0c0ce
source/mir/array/primitives.d
@@ -172,3 +172,16 @@ unittest
172
ar.popBackExactly!0(1); // Slice-like API
173
assert(ar == []);
174
}
175
+
176
+///
177
+size_t length(size_t d : 0, T)(T[] array)
178
+{
179
+ pragma(inline, true);
180
+ return array.length;
181
+}
182
183
184
+unittest
185
186
+ assert([1, 2].length!0 == 2);
187
source/mir/primitives.d
@@ -75,12 +75,5 @@ template DimensionCount(T)
75
enum size_t DimensionCount = 1;
76
77
78
-///
79
-size_t length(size_t d : 0, T)(T[] array)
80
-{
81
- pragma(inline, true);
82
- return array.length;
83
-}
84
-
85
///
86
alias elementsCount = length;
0 commit comments