mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2025-07-16 15:14:13 +00:00
fix Issue #49
This commit is contained in:
parent
350e883d35
commit
88ee58bcf4
80 changed files with 1547 additions and 164 deletions
|
@ -30,8 +30,10 @@ Examples
|
|||
using namespace sprout;
|
||||
|
||||
auto x = array<int, 10>{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}};
|
||||
x.assign(0);
|
||||
SPROUT_ASSERT_MSG(x[0] == 0, "filled with 0.");
|
||||
int main() {
|
||||
x.assign(0);
|
||||
SPROUT_ASSERT_MSG(x[0] == 0, "filled with 0.");
|
||||
}
|
||||
|
||||
.. sourcecode:: c++
|
||||
|
||||
|
|
|
@ -30,8 +30,10 @@ Examples
|
|||
using namespace sprout;
|
||||
|
||||
auto x = array<int, 10>{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}};
|
||||
x.fill(0);
|
||||
SPROUT_ASSERT_MSG(x[0] == 0, "filled with 0.");
|
||||
int main() {
|
||||
x.fill(0);
|
||||
SPROUT_ASSERT_MSG(x[0] == 0, "filled with 0.");
|
||||
}
|
||||
|
||||
.. sourcecode:: c++
|
||||
|
||||
|
|
|
@ -35,8 +35,10 @@ Examples
|
|||
|
||||
auto x = array<int, 10>{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}};
|
||||
SPROUT_STATIC_CONSTEXPR auto y = array<int, 10>{{10, 9, 8, 7, 6, 5, 4, 3, 2, 1}};
|
||||
x = y;
|
||||
SPROUT_ASSERT_MSG(x == y, "y is assigned to x.");
|
||||
int main() {
|
||||
x = y;
|
||||
SPROUT_ASSERT_MSG(x == y, "y is assigned to x.");
|
||||
}
|
||||
|
||||
Header
|
||||
========================================
|
||||
|
|
|
@ -33,8 +33,8 @@ Examples
|
|||
using namespace sprout;
|
||||
|
||||
using type = array<int, 10>;
|
||||
SPROUT_STATIC_CONSTEXPR auto size = std::tuple_size<type>::value;
|
||||
static_assert(size == 10, "tuple size of array is 10.");
|
||||
SPROUT_STATIC_CONSTEXPR auto n = std::tuple_size<type>::value;
|
||||
static_assert(n == 10, "tuple size of array is 10.");
|
||||
|
||||
Header
|
||||
========================================
|
||||
|
|
|
@ -32,8 +32,10 @@ Examples
|
|||
|
||||
auto x = array<int, 10>{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}};
|
||||
auto y = array<int, 10>{{10, 9, 8, 7, 6, 5, 4, 3, 2, 1}};
|
||||
swap(x, y);
|
||||
SPROUT_ASSERT_MSG(x[0] = 10 && y[0] == 1, "each element are swapped.");
|
||||
int main() {
|
||||
swap(x, y);
|
||||
SPROUT_ASSERT_MSG(x[0] == 10 && y[0] == 1, "each element are swapped.");
|
||||
}
|
||||
|
||||
Complexity
|
||||
========================================
|
||||
|
|
|
@ -29,8 +29,10 @@ Examples
|
|||
|
||||
auto x = array<int, 10>{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}};
|
||||
auto y = array<int, 10>{{10, 9, 8, 7, 6, 5, 4, 3, 2, 1}};
|
||||
x.swap(y);
|
||||
SPROUT_ASSERT_MSG(x[0] == 10 && y[0] == 1, "each element are swapped.");
|
||||
int main() {
|
||||
x.swap(y);
|
||||
SPROUT_ASSERT_MSG(x[0] == 10 && y[0] == 1, "each element are swapped.");
|
||||
}
|
||||
|
||||
Complexity
|
||||
========================================
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue