This commit is contained in:
Bolero-MURAKAMI 2013-09-13 17:22:10 +09:00
parent 350e883d35
commit 88ee58bcf4
80 changed files with 1547 additions and 164 deletions

View file

@ -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++

View file

@ -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++

View file

@ -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
========================================

View file

@ -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
========================================

View file

@ -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
========================================

View file

@ -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
========================================