This commit is contained in:
bolero-MURAKAMI 2014-07-02 22:16:29 +09:00
parent 93e22a984d
commit 15c3f55ebb
69 changed files with 406 additions and 367 deletions

View file

@ -24,7 +24,7 @@ namespace testspr {
{ {
SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 5>{{5, 1, 4, 2, 3}}; SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 5>{{5, 1, 4, 2, 3}};
// ソート // sort
{ {
SPROUT_STATIC_CONSTEXPR auto sorted = sprout::bogo_sort( SPROUT_STATIC_CONSTEXPR auto sorted = sprout::bogo_sort(
arr1, arr1,
@ -45,8 +45,8 @@ namespace testspr {
array<int, 5>{{1, 2, 3, 4, 5}} array<int, 5>{{1, 2, 3, 4, 5}}
)); ));
} }
// ソート // sort
// 範囲の切り出し // from sub range
{ {
SPROUT_STATIC_CONSTEXPR auto sorted = sprout::bogo_sort( SPROUT_STATIC_CONSTEXPR auto sorted = sprout::bogo_sort(
sprout::sub(arr1, 1, 4), sprout::sub(arr1, 1, 4),
@ -79,7 +79,7 @@ namespace testspr {
{ {
SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 5>{{5, 1, 4, 2, 3}}; SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 5>{{5, 1, 4, 2, 3}};
// ソート // sort
{ {
SPROUT_STATIC_CONSTEXPR auto sorted = sprout::bogo_sort( SPROUT_STATIC_CONSTEXPR auto sorted = sprout::bogo_sort(
arr1, arr1,
@ -102,8 +102,8 @@ namespace testspr {
array<int, 5>{{1, 2, 3, 4, 5}} array<int, 5>{{1, 2, 3, 4, 5}}
)); ));
} }
// ソート // sort
// 範囲の切り出し // from sub range
{ {
SPROUT_STATIC_CONSTEXPR auto sorted = sprout::bogo_sort( SPROUT_STATIC_CONSTEXPR auto sorted = sprout::bogo_sort(
sprout::sub(arr1, 1, 4), sprout::sub(arr1, 1, 4),
@ -139,7 +139,7 @@ namespace testspr {
{ {
SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 4>{{1, 4, 2, 3}}; SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 4>{{1, 4, 2, 3}};
// ソート // sort
{ {
SPROUT_STATIC_CONSTEXPR auto sorted = sprout::bogo_sort( SPROUT_STATIC_CONSTEXPR auto sorted = sprout::bogo_sort(
arr1, arr1,
@ -160,8 +160,8 @@ namespace testspr {
array<int, 4>{{1, 2, 3, 4}} array<int, 4>{{1, 2, 3, 4}}
)); ));
} }
// ソート // sort
// 範囲の切り出し // from sub range
{ {
SPROUT_STATIC_CONSTEXPR auto sorted = sprout::bogo_sort( SPROUT_STATIC_CONSTEXPR auto sorted = sprout::bogo_sort(
sprout::sub(arr1, 1, 3), sprout::sub(arr1, 1, 3),
@ -194,7 +194,7 @@ namespace testspr {
{ {
SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 4>{{1, 4, 2, 3}}; SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 4>{{1, 4, 2, 3}};
// ソート // sort
{ {
SPROUT_STATIC_CONSTEXPR auto sorted = sprout::bogo_sort( SPROUT_STATIC_CONSTEXPR auto sorted = sprout::bogo_sort(
arr1, arr1,
@ -217,8 +217,8 @@ namespace testspr {
array<int, 4>{{1, 2, 3, 4}} array<int, 4>{{1, 2, 3, 4}}
)); ));
} }
// ソート // sort
// 範囲の切り出し // from sub range
{ {
SPROUT_STATIC_CONSTEXPR auto sorted = sprout::bogo_sort( SPROUT_STATIC_CONSTEXPR auto sorted = sprout::bogo_sort(
sprout::sub(arr1, 1, 3), sprout::sub(arr1, 1, 3),

View file

@ -25,7 +25,7 @@ namespace testspr {
SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 5>{{5, 1, 4, 2, 3}}; SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 5>{{5, 1, 4, 2, 3}};
SPROUT_STATIC_CONSTEXPR auto g = sprout::random::default_random_engine(SPROUT_UNIQUE_SEED); SPROUT_STATIC_CONSTEXPR auto g = sprout::random::default_random_engine(SPROUT_UNIQUE_SEED);
// ソート // sort
{ {
SPROUT_STATIC_CONSTEXPR auto sorted = sprout::bogo_sort_result( SPROUT_STATIC_CONSTEXPR auto sorted = sprout::bogo_sort_result(
arr1, arr1,
@ -56,8 +56,8 @@ namespace testspr {
); );
TESTSPR_BOTH_ASSERT(sprout::get<1>(sorted) == sprout::get<1>(sorted2)); TESTSPR_BOTH_ASSERT(sprout::get<1>(sorted) == sprout::get<1>(sorted2));
} }
// ソート // sort
// 範囲の切り出し // from sub range
{ {
SPROUT_STATIC_CONSTEXPR auto sorted = sprout::bogo_sort_result( SPROUT_STATIC_CONSTEXPR auto sorted = sprout::bogo_sort_result(
sprout::sub(arr1, 1, 4), sprout::sub(arr1, 1, 4),
@ -101,7 +101,7 @@ namespace testspr {
SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 5>{{5, 1, 4, 2, 3}}; SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 5>{{5, 1, 4, 2, 3}};
SPROUT_STATIC_CONSTEXPR auto g = sprout::random::default_random_engine(SPROUT_UNIQUE_SEED); SPROUT_STATIC_CONSTEXPR auto g = sprout::random::default_random_engine(SPROUT_UNIQUE_SEED);
// ソート // sort
{ {
SPROUT_STATIC_CONSTEXPR auto sorted = sprout::bogo_sort_result( SPROUT_STATIC_CONSTEXPR auto sorted = sprout::bogo_sort_result(
arr1, arr1,
@ -134,8 +134,8 @@ namespace testspr {
); );
TESTSPR_BOTH_ASSERT(sprout::get<1>(sorted) == sprout::get<1>(sorted2)); TESTSPR_BOTH_ASSERT(sprout::get<1>(sorted) == sprout::get<1>(sorted2));
} }
// ソート // sort
// 範囲の切り出し // from sub range
{ {
SPROUT_STATIC_CONSTEXPR auto sorted = sprout::bogo_sort_result( SPROUT_STATIC_CONSTEXPR auto sorted = sprout::bogo_sort_result(
sprout::sub(arr1, 1, 4), sprout::sub(arr1, 1, 4),
@ -182,7 +182,7 @@ namespace testspr {
SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 4>{{1, 4, 2, 3}}; SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 4>{{1, 4, 2, 3}};
SPROUT_STATIC_CONSTEXPR auto g = sprout::random::default_random_engine(SPROUT_UNIQUE_SEED); SPROUT_STATIC_CONSTEXPR auto g = sprout::random::default_random_engine(SPROUT_UNIQUE_SEED);
// ソート // sort
{ {
SPROUT_STATIC_CONSTEXPR auto sorted = sprout::bogo_sort_result( SPROUT_STATIC_CONSTEXPR auto sorted = sprout::bogo_sort_result(
arr1, arr1,
@ -213,8 +213,8 @@ namespace testspr {
); );
TESTSPR_BOTH_ASSERT(sprout::get<1>(sorted) == sprout::get<1>(sorted2)); TESTSPR_BOTH_ASSERT(sprout::get<1>(sorted) == sprout::get<1>(sorted2));
} }
// ソート // sort
// 範囲の切り出し // from sub range
{ {
SPROUT_STATIC_CONSTEXPR auto sorted = sprout::bogo_sort_result( SPROUT_STATIC_CONSTEXPR auto sorted = sprout::bogo_sort_result(
sprout::sub(arr1, 1, 3), sprout::sub(arr1, 1, 3),
@ -258,7 +258,7 @@ namespace testspr {
SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 4>{{1, 4, 2, 3}}; SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 4>{{1, 4, 2, 3}};
SPROUT_STATIC_CONSTEXPR auto g = sprout::random::default_random_engine(SPROUT_UNIQUE_SEED); SPROUT_STATIC_CONSTEXPR auto g = sprout::random::default_random_engine(SPROUT_UNIQUE_SEED);
// ソート // sort
{ {
SPROUT_STATIC_CONSTEXPR auto sorted = sprout::bogo_sort_result( SPROUT_STATIC_CONSTEXPR auto sorted = sprout::bogo_sort_result(
arr1, arr1,
@ -291,8 +291,8 @@ namespace testspr {
); );
TESTSPR_BOTH_ASSERT(sprout::get<1>(sorted) == sprout::get<1>(sorted2)); TESTSPR_BOTH_ASSERT(sprout::get<1>(sorted) == sprout::get<1>(sorted2));
} }
// ソート // sort
// 範囲の切り出し // from sub range
{ {
SPROUT_STATIC_CONSTEXPR auto sorted = sprout::bogo_sort_result( SPROUT_STATIC_CONSTEXPR auto sorted = sprout::bogo_sort_result(
sprout::sub(arr1, 1, 3), sprout::sub(arr1, 1, 3),

View file

@ -22,7 +22,7 @@ namespace testspr {
{ {
SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 5>{{5, 1, 4, 2, 3}}; SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 5>{{5, 1, 4, 2, 3}};
// ソート // sort
{ {
SPROUT_STATIC_CONSTEXPR auto sorted = sprout::bozo_sort( SPROUT_STATIC_CONSTEXPR auto sorted = sprout::bozo_sort(
arr1, arr1,
@ -43,8 +43,8 @@ namespace testspr {
array<int, 5>{{1, 2, 3, 4, 5}} array<int, 5>{{1, 2, 3, 4, 5}}
)); ));
} }
// ソート // sort
// 範囲の切り出し // from sub range
{ {
SPROUT_STATIC_CONSTEXPR auto sorted = sprout::bozo_sort( SPROUT_STATIC_CONSTEXPR auto sorted = sprout::bozo_sort(
sprout::sub(arr1, 1, 4), sprout::sub(arr1, 1, 4),
@ -77,7 +77,7 @@ namespace testspr {
{ {
SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 5>{{5, 1, 4, 2, 3}}; SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 5>{{5, 1, 4, 2, 3}};
// ソート // sort
{ {
SPROUT_STATIC_CONSTEXPR auto sorted = sprout::bozo_sort( SPROUT_STATIC_CONSTEXPR auto sorted = sprout::bozo_sort(
arr1, arr1,
@ -100,8 +100,8 @@ namespace testspr {
array<int, 5>{{1, 2, 3, 4, 5}} array<int, 5>{{1, 2, 3, 4, 5}}
)); ));
} }
// ソート // sort
// 範囲の切り出し // from sub range
{ {
SPROUT_STATIC_CONSTEXPR auto sorted = sprout::bozo_sort( SPROUT_STATIC_CONSTEXPR auto sorted = sprout::bozo_sort(
sprout::sub(arr1, 1, 4), sprout::sub(arr1, 1, 4),

View file

@ -23,7 +23,7 @@ namespace testspr {
SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 5>{{5, 1, 4, 2, 3}}; SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 5>{{5, 1, 4, 2, 3}};
SPROUT_STATIC_CONSTEXPR auto g = sprout::random::default_random_engine(SPROUT_UNIQUE_SEED); SPROUT_STATIC_CONSTEXPR auto g = sprout::random::default_random_engine(SPROUT_UNIQUE_SEED);
// ソート // sort
{ {
SPROUT_STATIC_CONSTEXPR auto sorted = sprout::bozo_sort_result( SPROUT_STATIC_CONSTEXPR auto sorted = sprout::bozo_sort_result(
arr1, arr1,
@ -54,8 +54,8 @@ namespace testspr {
); );
TESTSPR_BOTH_ASSERT(sprout::get<1>(sorted) == sprout::get<1>(sorted2)); TESTSPR_BOTH_ASSERT(sprout::get<1>(sorted) == sprout::get<1>(sorted2));
} }
// ソート // sort
// 範囲の切り出し // from sub range
{ {
SPROUT_STATIC_CONSTEXPR auto sorted = sprout::bozo_sort_result( SPROUT_STATIC_CONSTEXPR auto sorted = sprout::bozo_sort_result(
sprout::sub(arr1, 1, 4), sprout::sub(arr1, 1, 4),
@ -99,7 +99,7 @@ namespace testspr {
SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 5>{{5, 1, 4, 2, 3}}; SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 5>{{5, 1, 4, 2, 3}};
SPROUT_STATIC_CONSTEXPR auto g = sprout::random::default_random_engine(SPROUT_UNIQUE_SEED); SPROUT_STATIC_CONSTEXPR auto g = sprout::random::default_random_engine(SPROUT_UNIQUE_SEED);
// ソート // sort
{ {
SPROUT_STATIC_CONSTEXPR auto sorted = sprout::bozo_sort_result( SPROUT_STATIC_CONSTEXPR auto sorted = sprout::bozo_sort_result(
arr1, arr1,
@ -132,8 +132,8 @@ namespace testspr {
); );
TESTSPR_BOTH_ASSERT(sprout::get<1>(sorted) == sprout::get<1>(sorted2)); TESTSPR_BOTH_ASSERT(sprout::get<1>(sorted) == sprout::get<1>(sorted2));
} }
// ソート // sort
// 範囲の切り出し // from sub range
{ {
SPROUT_STATIC_CONSTEXPR auto sorted = sprout::bozo_sort_result( SPROUT_STATIC_CONSTEXPR auto sorted = sprout::bozo_sort_result(
sprout::sub(arr1, 1, 4), sprout::sub(arr1, 1, 4),

View file

@ -20,7 +20,7 @@ namespace testspr {
{ {
SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}}; SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}};
// クランプ (4 <= x <= 7) // clamp (4 <= x <= 7)
{ {
SPROUT_STATIC_CONSTEXPR auto clamped = sprout::clamp_range( SPROUT_STATIC_CONSTEXPR auto clamped = sprout::clamp_range(
arr1, arr1,
@ -43,8 +43,8 @@ namespace testspr {
array<int, 10>{{4, 4, 4, 4, 5, 6, 7, 7, 7, 7}} array<int, 10>{{4, 4, 4, 4, 5, 6, 7, 7, 7, 7}}
)); ));
} }
// クランプ (4 <= x <= 7) // clamp (4 <= x <= 7)
// 範囲の切り出し // from sub range
{ {
SPROUT_STATIC_CONSTEXPR auto clamped = sprout::clamp_range( SPROUT_STATIC_CONSTEXPR auto clamped = sprout::clamp_range(
sprout::sub(arr1, 2, 8), sprout::sub(arr1, 2, 8),
@ -79,7 +79,7 @@ namespace testspr {
{ {
SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}}; SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}};
// クランプ (4 <= x <= 7) // clamp (4 <= x <= 7)
{ {
SPROUT_STATIC_CONSTEXPR auto clamped = sprout::clamp_range( SPROUT_STATIC_CONSTEXPR auto clamped = sprout::clamp_range(
arr1, arr1,
@ -104,8 +104,8 @@ namespace testspr {
array<int, 10>{{4, 4, 4, 4, 5, 6, 7, 7, 7, 7}} array<int, 10>{{4, 4, 4, 4, 5, 6, 7, 7, 7, 7}}
)); ));
} }
// クランプ (4 <= x <= 7) // clamp (4 <= x <= 7)
// 範囲の切り出し // from sub range
{ {
SPROUT_STATIC_CONSTEXPR auto clamped = sprout::clamp_range( SPROUT_STATIC_CONSTEXPR auto clamped = sprout::clamp_range(
sprout::sub(arr1, 2, 8), sprout::sub(arr1, 2, 8),

View file

@ -22,7 +22,7 @@ namespace testspr {
SPROUT_STATIC_CONSTEXPR auto arr2 = array<int, 10>{{}}; SPROUT_STATIC_CONSTEXPR auto arr2 = array<int, 10>{{}};
SPROUT_STATIC_CONSTEXPR auto arr3 = array<int, 4>{{}}; SPROUT_STATIC_CONSTEXPR auto arr3 = array<int, 4>{{}};
// [2 .. 8) の範囲をクランプ (4 <= x <= 7) // clamp in range [2 .. 8) (4 <= x <= 7)
{ {
SPROUT_STATIC_CONSTEXPR auto clamped = sprout::clamp_range_copy( SPROUT_STATIC_CONSTEXPR auto clamped = sprout::clamp_range_copy(
sprout::begin(arr1) + 2, sprout::begin(arr1) + 2,
@ -49,8 +49,8 @@ namespace testspr {
array<int, 6>{{4, 4, 5, 6, 7, 7}} array<int, 6>{{4, 4, 5, 6, 7, 7}}
)); ));
} }
// [2 .. 8) の範囲をクランプ (4 <= x <= 7) // clamp in range [2 .. 8) (4 <= x <= 7)
// 出力範囲をオーバーする場合 // overrun from output range
{ {
SPROUT_STATIC_CONSTEXPR auto clamped = sprout::clamp_range_copy( SPROUT_STATIC_CONSTEXPR auto clamped = sprout::clamp_range_copy(
sprout::begin(arr1) + 2, sprout::begin(arr1) + 2,
@ -77,8 +77,8 @@ namespace testspr {
array<int, 4>{{4, 4, 5, 6}} array<int, 4>{{4, 4, 5, 6}}
)); ));
} }
// [2 .. 8) の範囲をクランプ (4 <= x <= 7) // clamp in range [2 .. 8) (4 <= x <= 7)
// 出力範囲の切り出し // to sub range
{ {
SPROUT_STATIC_CONSTEXPR auto clamped = sprout::clamp_range_copy( SPROUT_STATIC_CONSTEXPR auto clamped = sprout::clamp_range_copy(
sprout::begin(arr1) + 2, sprout::begin(arr1) + 2,
@ -119,7 +119,7 @@ namespace testspr {
SPROUT_STATIC_CONSTEXPR auto arr2 = array<int, 10>{{}}; SPROUT_STATIC_CONSTEXPR auto arr2 = array<int, 10>{{}};
SPROUT_STATIC_CONSTEXPR auto arr3 = array<int, 4>{{}}; SPROUT_STATIC_CONSTEXPR auto arr3 = array<int, 4>{{}};
// [2 .. 8) の範囲をクランプ (4 <= x <= 7) // clamp in range [2 .. 8) (4 <= x <= 7)
{ {
SPROUT_STATIC_CONSTEXPR auto clamped = sprout::clamp_range_copy( SPROUT_STATIC_CONSTEXPR auto clamped = sprout::clamp_range_copy(
sprout::begin(arr1) + 2, sprout::begin(arr1) + 2,
@ -148,8 +148,8 @@ namespace testspr {
array<int, 6>{{4, 4, 5, 6, 7, 7}} array<int, 6>{{4, 4, 5, 6, 7, 7}}
)); ));
} }
// [2 .. 8) の範囲をクランプ (4 <= x <= 7) // clamp in range [2 .. 8) (4 <= x <= 7)
// 出力範囲をオーバーする場合 // overrun from output range
{ {
SPROUT_STATIC_CONSTEXPR auto clamped = sprout::clamp_range_copy( SPROUT_STATIC_CONSTEXPR auto clamped = sprout::clamp_range_copy(
sprout::begin(arr1) + 2, sprout::begin(arr1) + 2,
@ -178,8 +178,8 @@ namespace testspr {
array<int, 4>{{4, 4, 5, 6}} array<int, 4>{{4, 4, 5, 6}}
)); ));
} }
// [2 .. 8) の範囲をクランプ (4 <= x <= 7) // clamp in range [2 .. 8) (4 <= x <= 7)
// 出力範囲の切り出し // to sub range
{ {
SPROUT_STATIC_CONSTEXPR auto clamped = sprout::clamp_range_copy( SPROUT_STATIC_CONSTEXPR auto clamped = sprout::clamp_range_copy(
sprout::begin(arr1) + 2, sprout::begin(arr1) + 2,

View file

@ -22,7 +22,7 @@ namespace testspr {
SPROUT_STATIC_CONSTEXPR auto arr2 = array<int, 10>{{}}; SPROUT_STATIC_CONSTEXPR auto arr2 = array<int, 10>{{}};
SPROUT_STATIC_CONSTEXPR auto arr3 = array<int, 4>{{}}; SPROUT_STATIC_CONSTEXPR auto arr3 = array<int, 4>{{}};
// [2 .. 8) の範囲をコピー // copy in range [2 .. 8)
{ {
SPROUT_STATIC_CONSTEXPR auto copied = sprout::copy( SPROUT_STATIC_CONSTEXPR auto copied = sprout::copy(
sprout::begin(arr1) + 2, sprout::begin(arr1) + 2,
@ -45,8 +45,8 @@ namespace testspr {
array<int, 6>{{3, 4, 5, 6, 7, 8}} array<int, 6>{{3, 4, 5, 6, 7, 8}}
)); ));
} }
// [2 .. 8) の範囲をコピー // copy in range [2 .. 8)
// 出力範囲をオーバーする場合 // overrun from output range
{ {
SPROUT_STATIC_CONSTEXPR auto copied = sprout::copy( SPROUT_STATIC_CONSTEXPR auto copied = sprout::copy(
sprout::begin(arr1) + 2, sprout::begin(arr1) + 2,
@ -69,8 +69,8 @@ namespace testspr {
array<int, 4>{{3, 4, 5, 6}} array<int, 4>{{3, 4, 5, 6}}
)); ));
} }
// [2 .. 8) の範囲をコピー // copy in range [2 .. 8)
// 出力範囲の切り出し // to sub range
{ {
SPROUT_STATIC_CONSTEXPR auto copied = sprout::copy( SPROUT_STATIC_CONSTEXPR auto copied = sprout::copy(
sprout::begin(arr1) + 2, sprout::begin(arr1) + 2,
@ -102,7 +102,7 @@ namespace testspr {
)); ));
} }
// [2 .. 8) の範囲をコピー // copy in range [2 .. 8)
{ {
SPROUT_STATIC_CONSTEXPR auto copied = sprout::copy( SPROUT_STATIC_CONSTEXPR auto copied = sprout::copy(
testspr::reduct_input(sprout::begin(arr1) + 2), testspr::reduct_input(sprout::begin(arr1) + 2),
@ -126,8 +126,8 @@ namespace testspr {
// array<int, 6>{{3, 4, 5, 6, 7, 8}} // array<int, 6>{{3, 4, 5, 6, 7, 8}}
// )); // ));
// } // }
// [2 .. 8) の範囲をコピー // copy in range [2 .. 8)
// 出力範囲をオーバーする場合 // overrun from output range
{ {
SPROUT_STATIC_CONSTEXPR auto copied = sprout::copy( SPROUT_STATIC_CONSTEXPR auto copied = sprout::copy(
testspr::reduct_input(sprout::begin(arr1) + 2), testspr::reduct_input(sprout::begin(arr1) + 2),
@ -151,8 +151,8 @@ namespace testspr {
// array<int, 4>{{3, 4, 5, 6}} // array<int, 4>{{3, 4, 5, 6}}
// )); // ));
// } // }
// [2 .. 8) の範囲をコピー // copy in range [2 .. 8)
// 出力範囲の切り出し // to sub range
{ {
SPROUT_STATIC_CONSTEXPR auto copied = sprout::copy( SPROUT_STATIC_CONSTEXPR auto copied = sprout::copy(
testspr::reduct_input(sprout::begin(arr1) + 2), testspr::reduct_input(sprout::begin(arr1) + 2),
@ -185,7 +185,7 @@ namespace testspr {
// )); // ));
// } // }
// [2 .. 8) の範囲をコピー // copy in range [2 .. 8)
{ {
SPROUT_STATIC_CONSTEXPR auto copied = sprout::copy( SPROUT_STATIC_CONSTEXPR auto copied = sprout::copy(
testspr::reduct_forward(sprout::begin(arr1) + 2), testspr::reduct_forward(sprout::begin(arr1) + 2),
@ -208,8 +208,8 @@ namespace testspr {
array<int, 6>{{3, 4, 5, 6, 7, 8}} array<int, 6>{{3, 4, 5, 6, 7, 8}}
)); ));
} }
// [2 .. 8) の範囲をコピー // copy in range [2 .. 8)
// 出力範囲をオーバーする場合 // overrun from output range
{ {
SPROUT_STATIC_CONSTEXPR auto copied = sprout::copy( SPROUT_STATIC_CONSTEXPR auto copied = sprout::copy(
testspr::reduct_forward(sprout::begin(arr1) + 2), testspr::reduct_forward(sprout::begin(arr1) + 2),
@ -232,8 +232,8 @@ namespace testspr {
array<int, 4>{{3, 4, 5, 6}} array<int, 4>{{3, 4, 5, 6}}
)); ));
} }
// [2 .. 8) の範囲をコピー // copy in range [2 .. 8)
// 出力範囲の切り出し // to sub range
{ {
SPROUT_STATIC_CONSTEXPR auto copied = sprout::copy( SPROUT_STATIC_CONSTEXPR auto copied = sprout::copy(
testspr::reduct_forward(sprout::begin(arr1) + 2), testspr::reduct_forward(sprout::begin(arr1) + 2),
@ -265,7 +265,7 @@ namespace testspr {
)); ));
} }
// [2 .. 8) の範囲をコピー // copy in range [2 .. 8)
{ {
SPROUT_STATIC_CONSTEXPR auto copied = sprout::copy( SPROUT_STATIC_CONSTEXPR auto copied = sprout::copy(
testspr::reduct_random_access(sprout::begin(arr1) + 2), testspr::reduct_random_access(sprout::begin(arr1) + 2),
@ -288,8 +288,8 @@ namespace testspr {
array<int, 6>{{3, 4, 5, 6, 7, 8}} array<int, 6>{{3, 4, 5, 6, 7, 8}}
)); ));
} }
// [2 .. 8) の範囲をコピー // copy in range [2 .. 8)
// 出力範囲をオーバーする場合 // overrun from output range
{ {
SPROUT_STATIC_CONSTEXPR auto copied = sprout::copy( SPROUT_STATIC_CONSTEXPR auto copied = sprout::copy(
testspr::reduct_random_access(sprout::begin(arr1) + 2), testspr::reduct_random_access(sprout::begin(arr1) + 2),
@ -312,8 +312,8 @@ namespace testspr {
array<int, 4>{{3, 4, 5, 6}} array<int, 4>{{3, 4, 5, 6}}
)); ));
} }
// [2 .. 8) の範囲をコピー // copy in range [2 .. 8)
// 出力範囲の切り出し // to sub range
{ {
SPROUT_STATIC_CONSTEXPR auto copied = sprout::copy( SPROUT_STATIC_CONSTEXPR auto copied = sprout::copy(
testspr::reduct_random_access(sprout::begin(arr1) + 2), testspr::reduct_random_access(sprout::begin(arr1) + 2),

View file

@ -22,7 +22,7 @@ namespace testspr {
SPROUT_STATIC_CONSTEXPR auto arr2 = array<int, 10>{{}}; SPROUT_STATIC_CONSTEXPR auto arr2 = array<int, 10>{{}};
SPROUT_STATIC_CONSTEXPR auto arr3 = array<int, 4>{{}}; SPROUT_STATIC_CONSTEXPR auto arr3 = array<int, 4>{{}};
// [2 .. 8) の範囲をコピー // copy in range [2 .. 8)
{ {
SPROUT_STATIC_CONSTEXPR auto copied = sprout::copy_backward( SPROUT_STATIC_CONSTEXPR auto copied = sprout::copy_backward(
sprout::begin(arr1) + 2, sprout::begin(arr1) + 2,
@ -45,8 +45,8 @@ namespace testspr {
array<int, 6>{{3, 4, 5, 6, 7, 8}} array<int, 6>{{3, 4, 5, 6, 7, 8}}
)); ));
} }
// [2 .. 8) の範囲をコピー // copy in range [2 .. 8)
// 出力範囲をオーバーする場合 // overrun from output range
{ {
SPROUT_STATIC_CONSTEXPR auto copied = sprout::copy_backward( SPROUT_STATIC_CONSTEXPR auto copied = sprout::copy_backward(
sprout::begin(arr1) + 2, sprout::begin(arr1) + 2,
@ -69,8 +69,8 @@ namespace testspr {
array<int, 4>{{5, 6, 7, 8}} array<int, 4>{{5, 6, 7, 8}}
)); ));
} }
// [2 .. 8) の範囲をコピー // copy in range [2 .. 8)
// 出力範囲の切り出し // to sub range
{ {
SPROUT_STATIC_CONSTEXPR auto copied = sprout::copy_backward( SPROUT_STATIC_CONSTEXPR auto copied = sprout::copy_backward(
sprout::begin(arr1) + 2, sprout::begin(arr1) + 2,

View file

@ -22,7 +22,7 @@ namespace testspr {
SPROUT_STATIC_CONSTEXPR auto arr2 = array<int, 10>{{}}; SPROUT_STATIC_CONSTEXPR auto arr2 = array<int, 10>{{}};
SPROUT_STATIC_CONSTEXPR auto arr3 = array<int, 4>{{}}; SPROUT_STATIC_CONSTEXPR auto arr3 = array<int, 4>{{}};
// 奇数をコピー // copy odd
{ {
SPROUT_STATIC_CONSTEXPR auto copied = sprout::copy_if( SPROUT_STATIC_CONSTEXPR auto copied = sprout::copy_if(
sprout::begin(arr1), sprout::begin(arr1),
@ -47,8 +47,8 @@ namespace testspr {
array<int, 5>{{1, 3, 5, 7, 9}} array<int, 5>{{1, 3, 5, 7, 9}}
)); ));
} }
// 奇数をコピー // copy odd
// 出力範囲をオーバーする場合 // overrun from output range
{ {
SPROUT_STATIC_CONSTEXPR auto copied = sprout::copy_if( SPROUT_STATIC_CONSTEXPR auto copied = sprout::copy_if(
sprout::begin(arr1), sprout::begin(arr1),
@ -73,8 +73,8 @@ namespace testspr {
array<int, 4>{{1, 3, 5, 7}} array<int, 4>{{1, 3, 5, 7}}
)); ));
} }
// 奇数をコピー // copy odd
// 出力範囲の切り出し // to sub range
{ {
SPROUT_STATIC_CONSTEXPR auto copied = sprout::copy_if( SPROUT_STATIC_CONSTEXPR auto copied = sprout::copy_if(
sprout::begin(arr1), sprout::begin(arr1),

View file

@ -21,7 +21,7 @@ namespace testspr {
SPROUT_STATIC_CONSTEXPR auto arr2 = array<int, 10>{{}}; SPROUT_STATIC_CONSTEXPR auto arr2 = array<int, 10>{{}};
SPROUT_STATIC_CONSTEXPR auto arr3 = array<int, 4>{{}}; SPROUT_STATIC_CONSTEXPR auto arr3 = array<int, 4>{{}};
// 6 要素をコピー // copy 6 elements
{ {
SPROUT_STATIC_CONSTEXPR auto copied = sprout::copy_n( SPROUT_STATIC_CONSTEXPR auto copied = sprout::copy_n(
sprout::begin(arr1) + 2, sprout::begin(arr1) + 2,
@ -45,8 +45,8 @@ namespace testspr {
)); ));
} }
// 6 要素をコピー // copy 6 elements
// 出力範囲をオーバーする場合 // overrun from output range
{ {
SPROUT_STATIC_CONSTEXPR auto copied = sprout::copy_n( SPROUT_STATIC_CONSTEXPR auto copied = sprout::copy_n(
sprout::begin(arr1) + 2, sprout::begin(arr1) + 2,
@ -69,8 +69,8 @@ namespace testspr {
array<int, 4>{{3, 4, 5, 6}} array<int, 4>{{3, 4, 5, 6}}
)); ));
} }
// 6 要素をコピー // copy 6 elements
// 出力範囲の切り出し // to sub range
{ {
SPROUT_STATIC_CONSTEXPR auto copied = sprout::copy_n( SPROUT_STATIC_CONSTEXPR auto copied = sprout::copy_n(
sprout::begin(arr1) + 2, sprout::begin(arr1) + 2,

View file

@ -22,7 +22,7 @@ namespace testspr {
SPROUT_STATIC_CONSTEXPR auto arr2 = array<int, 10>{{}}; SPROUT_STATIC_CONSTEXPR auto arr2 = array<int, 10>{{}};
SPROUT_STATIC_CONSTEXPR auto arr3 = array<int, 4>{{}}; SPROUT_STATIC_CONSTEXPR auto arr3 = array<int, 4>{{}};
// 6 未満をコピー // copy less than 6
{ {
SPROUT_STATIC_CONSTEXPR auto copied = sprout::copy_until( SPROUT_STATIC_CONSTEXPR auto copied = sprout::copy_until(
sprout::begin(arr1), sprout::begin(arr1),
@ -47,8 +47,8 @@ namespace testspr {
array<int, 5>{{1, 2, 3, 4, 5}} array<int, 5>{{1, 2, 3, 4, 5}}
)); ));
} }
// 8 未満をコピー // copy less than 8
// 出力範囲をオーバーする場合 // overrun from output range
{ {
SPROUT_STATIC_CONSTEXPR auto copied = sprout::copy_until( SPROUT_STATIC_CONSTEXPR auto copied = sprout::copy_until(
sprout::begin(arr1), sprout::begin(arr1),
@ -73,8 +73,8 @@ namespace testspr {
array<int, 4>{{1, 2, 3, 4}} array<int, 4>{{1, 2, 3, 4}}
)); ));
} }
// 8 未満をコピー // copy less than 8
// 出力範囲の切り出し // to sub range
{ {
SPROUT_STATIC_CONSTEXPR auto copied = sprout::copy_until( SPROUT_STATIC_CONSTEXPR auto copied = sprout::copy_until(
sprout::begin(arr1), sprout::begin(arr1),

View file

@ -22,7 +22,7 @@ namespace testspr {
SPROUT_STATIC_CONSTEXPR auto arr2 = array<int, 10>{{}}; SPROUT_STATIC_CONSTEXPR auto arr2 = array<int, 10>{{}};
SPROUT_STATIC_CONSTEXPR auto arr3 = array<int, 4>{{}}; SPROUT_STATIC_CONSTEXPR auto arr3 = array<int, 4>{{}};
// 6 未満をコピー // copy less than 6
{ {
SPROUT_STATIC_CONSTEXPR auto copied = sprout::copy_while( SPROUT_STATIC_CONSTEXPR auto copied = sprout::copy_while(
sprout::begin(arr1), sprout::begin(arr1),
@ -47,8 +47,8 @@ namespace testspr {
array<int, 5>{{1, 2, 3, 4, 5}} array<int, 5>{{1, 2, 3, 4, 5}}
)); ));
} }
// 8 未満をコピー // copy less than 8
// 出力範囲をオーバーする場合 // overrun from output range
{ {
SPROUT_STATIC_CONSTEXPR auto copied = sprout::copy_while( SPROUT_STATIC_CONSTEXPR auto copied = sprout::copy_while(
sprout::begin(arr1), sprout::begin(arr1),
@ -73,8 +73,8 @@ namespace testspr {
array<int, 4>{{1, 2, 3, 4}} array<int, 4>{{1, 2, 3, 4}}
)); ));
} }
// 8 未満をコピー // copy less than 8
// 出力範囲の切り出し // to sub range
{ {
SPROUT_STATIC_CONSTEXPR auto copied = sprout::copy_while( SPROUT_STATIC_CONSTEXPR auto copied = sprout::copy_while(
sprout::begin(arr1), sprout::begin(arr1),

View file

@ -20,7 +20,7 @@ namespace testspr {
{ {
SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}}; SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}};
// 充填 (-1) // fill (-1)
{ {
SPROUT_STATIC_CONSTEXPR auto filled = sprout::fill( SPROUT_STATIC_CONSTEXPR auto filled = sprout::fill(
arr1, arr1,
@ -41,8 +41,8 @@ namespace testspr {
array<int, 10>{{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}} array<int, 10>{{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}
)); ));
} }
// 充填 (-1) // fill (-1)
// 範囲の切り出し // from sub range
{ {
SPROUT_STATIC_CONSTEXPR auto filled = sprout::fill( SPROUT_STATIC_CONSTEXPR auto filled = sprout::fill(
sprout::sub(arr1, 2, 8), sprout::sub(arr1, 2, 8),

View file

@ -20,7 +20,7 @@ namespace testspr {
{ {
SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}}; SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}};
// 充填 (-1) // fill (-1)
{ {
SPROUT_STATIC_CONSTEXPR auto filled = sprout::fill_n( SPROUT_STATIC_CONSTEXPR auto filled = sprout::fill_n(
arr1, arr1,
@ -43,8 +43,8 @@ namespace testspr {
array<int, 4>{{-1, -1, -1, -1}} array<int, 4>{{-1, -1, -1, -1}}
)); ));
} }
// 充填 (-1) // fill (-1)
// 範囲の切り出し // from sub range
{ {
SPROUT_STATIC_CONSTEXPR auto filled = sprout::fill_n( SPROUT_STATIC_CONSTEXPR auto filled = sprout::fill_n(
sprout::sub(arr1, 2, 8), sprout::sub(arr1, 2, 8),

View file

@ -20,7 +20,7 @@ namespace testspr {
{ {
SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{}}; SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{}};
// 生成 // generate
{ {
SPROUT_STATIC_CONSTEXPR auto generated = sprout::generate( SPROUT_STATIC_CONSTEXPR auto generated = sprout::generate(
arr1, arr1,
@ -41,8 +41,8 @@ namespace testspr {
array<int, 10>{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}} array<int, 10>{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}}
)); ));
} }
// 生成 // generate
// 範囲の切り出し // from sub range
{ {
SPROUT_STATIC_CONSTEXPR auto generated = sprout::generate( SPROUT_STATIC_CONSTEXPR auto generated = sprout::generate(
sprout::sub(arr1, 2, 8), sprout::sub(arr1, 2, 8),

View file

@ -20,7 +20,7 @@ namespace testspr {
{ {
SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{}}; SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{}};
// 生成 // generate
{ {
SPROUT_STATIC_CONSTEXPR auto generated = sprout::generate_n( SPROUT_STATIC_CONSTEXPR auto generated = sprout::generate_n(
arr1, arr1,
@ -43,8 +43,8 @@ namespace testspr {
array<int, 4>{{1, 2, 3, 4}} array<int, 4>{{1, 2, 3, 4}}
)); ));
} }
// 生成 // generate
// 範囲の切り出し // from sub range
{ {
SPROUT_STATIC_CONSTEXPR auto generated = sprout::generate_n( SPROUT_STATIC_CONSTEXPR auto generated = sprout::generate_n(
sprout::sub(arr1, 2, 8), sprout::sub(arr1, 2, 8),

View file

@ -20,7 +20,7 @@ namespace testspr {
{ {
SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{1, 3, 5, 7, 9, 2, 4, 6, 8, 10}}; SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{1, 3, 5, 7, 9, 2, 4, 6, 8, 10}};
// マージ // merge
{ {
SPROUT_STATIC_CONSTEXPR auto merged = sprout::inplace_merge( SPROUT_STATIC_CONSTEXPR auto merged = sprout::inplace_merge(
arr1, arr1,
@ -41,8 +41,8 @@ namespace testspr {
array<int, 10>{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}} array<int, 10>{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}}
)); ));
} }
// マージ // merge
// 範囲の切り出し // from sub range
{ {
SPROUT_STATIC_CONSTEXPR auto merged = sprout::inplace_merge( SPROUT_STATIC_CONSTEXPR auto merged = sprout::inplace_merge(
sprout::sub(arr1, 2, 8), sprout::sub(arr1, 2, 8),
@ -75,7 +75,7 @@ namespace testspr {
{ {
SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{1, 3, 5, 7, 9, 2, 4, 6, 8, 10}}; SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{1, 3, 5, 7, 9, 2, 4, 6, 8, 10}};
// マージ // merge
{ {
SPROUT_STATIC_CONSTEXPR auto merged = sprout::inplace_merge( SPROUT_STATIC_CONSTEXPR auto merged = sprout::inplace_merge(
arr1, arr1,
@ -98,8 +98,8 @@ namespace testspr {
array<int, 10>{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}} array<int, 10>{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}}
)); ));
} }
// マージ // merge
// 範囲の切り出し // from sub range
{ {
SPROUT_STATIC_CONSTEXPR auto merged = sprout::inplace_merge( SPROUT_STATIC_CONSTEXPR auto merged = sprout::inplace_merge(
sprout::sub(arr1, 2, 8), sprout::sub(arr1, 2, 8),

View file

@ -20,7 +20,7 @@ namespace testspr {
{ {
SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{10, 7, 8, 6, 9, 2, 5, 3, 4, 1}}; SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{10, 7, 8, 6, 9, 2, 5, 3, 4, 1}};
// ヒープ作成 // make heap
{ {
SPROUT_STATIC_CONSTEXPR auto heap = sprout::make_heap( SPROUT_STATIC_CONSTEXPR auto heap = sprout::make_heap(
arr1 arr1
@ -39,8 +39,8 @@ namespace testspr {
array<int, 10>{{10, 9, 8, 6, 7, 2, 5, 3, 4, 1}} array<int, 10>{{10, 9, 8, 6, 7, 2, 5, 3, 4, 1}}
)); ));
} }
// ヒープ作成 // make heap
// 範囲の切り出し // from sub range
{ {
SPROUT_STATIC_CONSTEXPR auto heap = sprout::make_heap( SPROUT_STATIC_CONSTEXPR auto heap = sprout::make_heap(
sprout::sub(arr1, 2, 10) sprout::sub(arr1, 2, 10)
@ -71,7 +71,7 @@ namespace testspr {
{ {
SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{10, 7, 8, 6, 9, 2, 5, 3, 4, 1}}; SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{10, 7, 8, 6, 9, 2, 5, 3, 4, 1}};
// ヒープ作成 // make heap
{ {
SPROUT_STATIC_CONSTEXPR auto heap = sprout::make_heap( SPROUT_STATIC_CONSTEXPR auto heap = sprout::make_heap(
arr1, arr1,
@ -92,8 +92,8 @@ namespace testspr {
array<int, 10>{{10, 9, 8, 6, 7, 2, 5, 3, 4, 1}} array<int, 10>{{10, 9, 8, 6, 7, 2, 5, 3, 4, 1}}
)); ));
} }
// ヒープ作成 // make heap
// 範囲の切り出し // from sub range
{ {
SPROUT_STATIC_CONSTEXPR auto heap = sprout::make_heap( SPROUT_STATIC_CONSTEXPR auto heap = sprout::make_heap(
sprout::sub(arr1, 2, 10), sprout::sub(arr1, 2, 10),

View file

@ -20,7 +20,7 @@ namespace testspr {
{ {
SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{10, 7, 8, 6, 9, 2, 5, 3, 4, 1}}; SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{10, 7, 8, 6, 9, 2, 5, 3, 4, 1}};
// ヒープ作成 // make heap
{ {
SPROUT_STATIC_CONSTEXPR auto heap = sprout::make_partial_heap( SPROUT_STATIC_CONSTEXPR auto heap = sprout::make_partial_heap(
arr1, arr1,
@ -41,8 +41,8 @@ namespace testspr {
array<int, 5>{{5, 4, 1, 3, 2}} array<int, 5>{{5, 4, 1, 3, 2}}
)); ));
} }
// ヒープ作成 // make heap
// 範囲の切り出し // from sub range
{ {
SPROUT_STATIC_CONSTEXPR auto heap = sprout::make_partial_heap( SPROUT_STATIC_CONSTEXPR auto heap = sprout::make_partial_heap(
sprout::sub(arr1, 2, 10), sprout::sub(arr1, 2, 10),
@ -75,7 +75,7 @@ namespace testspr {
{ {
SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{10, 7, 8, 6, 9, 2, 5, 3, 4, 1}}; SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{10, 7, 8, 6, 9, 2, 5, 3, 4, 1}};
// ヒープ作成 // make heap
{ {
SPROUT_STATIC_CONSTEXPR auto heap = sprout::make_partial_heap( SPROUT_STATIC_CONSTEXPR auto heap = sprout::make_partial_heap(
arr1, arr1,
@ -98,8 +98,8 @@ namespace testspr {
array<int, 5>{{5, 4, 1, 3, 2}} array<int, 5>{{5, 4, 1, 3, 2}}
)); ));
} }
// ヒープ作成 // make heap
// 範囲の切り出し // from sub range
{ {
SPROUT_STATIC_CONSTEXPR auto heap = sprout::make_partial_heap( SPROUT_STATIC_CONSTEXPR auto heap = sprout::make_partial_heap(
sprout::sub(arr1, 2, 10), sprout::sub(arr1, 2, 10),

View file

@ -23,7 +23,7 @@ namespace testspr {
SPROUT_STATIC_CONSTEXPR auto arr2 = array<int, 10>{{}}; SPROUT_STATIC_CONSTEXPR auto arr2 = array<int, 10>{{}};
SPROUT_STATIC_CONSTEXPR auto arr3 = array<int, 4>{{}}; SPROUT_STATIC_CONSTEXPR auto arr3 = array<int, 4>{{}};
// マージ // merge
{ {
SPROUT_STATIC_CONSTEXPR auto merged = sprout::merge( SPROUT_STATIC_CONSTEXPR auto merged = sprout::merge(
sprout::begin(arr1), sprout::begin(arr1),
@ -50,8 +50,8 @@ namespace testspr {
array<int, 8>{{2, 3, 4, 5, 6, 7, 8, 9}} array<int, 8>{{2, 3, 4, 5, 6, 7, 8, 9}}
)); ));
} }
// マージ // merge
// 出力範囲をオーバーする場合 // overrun from output range
{ {
SPROUT_STATIC_CONSTEXPR auto merged = sprout::merge( SPROUT_STATIC_CONSTEXPR auto merged = sprout::merge(
sprout::begin(arr1), sprout::begin(arr1),
@ -78,8 +78,8 @@ namespace testspr {
array<int, 4>{{2, 3, 4, 5}} array<int, 4>{{2, 3, 4, 5}}
)); ));
} }
// マージ // merge
// 出力範囲の切り出し // to sub range
{ {
SPROUT_STATIC_CONSTEXPR auto merged = sprout::merge( SPROUT_STATIC_CONSTEXPR auto merged = sprout::merge(
sprout::begin(arr1), sprout::begin(arr1),
@ -121,7 +121,7 @@ namespace testspr {
SPROUT_STATIC_CONSTEXPR auto arr2 = array<int, 10>{{}}; SPROUT_STATIC_CONSTEXPR auto arr2 = array<int, 10>{{}};
SPROUT_STATIC_CONSTEXPR auto arr3 = array<int, 4>{{}}; SPROUT_STATIC_CONSTEXPR auto arr3 = array<int, 4>{{}};
// マージ // merge
{ {
SPROUT_STATIC_CONSTEXPR auto merged = sprout::merge( SPROUT_STATIC_CONSTEXPR auto merged = sprout::merge(
sprout::begin(arr1), sprout::begin(arr1),
@ -150,8 +150,8 @@ namespace testspr {
array<int, 8>{{2, 3, 4, 5, 6, 7, 8, 9}} array<int, 8>{{2, 3, 4, 5, 6, 7, 8, 9}}
)); ));
} }
// マージ // merge
// 出力範囲をオーバーする場合 // overrun from output range
{ {
SPROUT_STATIC_CONSTEXPR auto merged = sprout::merge( SPROUT_STATIC_CONSTEXPR auto merged = sprout::merge(
sprout::begin(arr1), sprout::begin(arr1),
@ -180,8 +180,8 @@ namespace testspr {
array<int, 4>{{2, 3, 4, 5}} array<int, 4>{{2, 3, 4, 5}}
)); ));
} }
// マージ // merge
// 出力範囲の切り出し // to sub range
{ {
SPROUT_STATIC_CONSTEXPR auto merged = sprout::merge( SPROUT_STATIC_CONSTEXPR auto merged = sprout::merge(
sprout::begin(arr1), sprout::begin(arr1),

View file

@ -20,7 +20,7 @@ namespace testspr {
{ {
SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 5>{{1, 2, 3, 4, 5}}; SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 5>{{1, 2, 3, 4, 5}};
// 順列 // next permutation
{ {
SPROUT_STATIC_CONSTEXPR auto permutation = sprout::next_permutation( SPROUT_STATIC_CONSTEXPR auto permutation = sprout::next_permutation(
arr1 arr1
@ -41,8 +41,8 @@ namespace testspr {
)); ));
TESTSPR_BOTH_ASSERT(permutation.second); TESTSPR_BOTH_ASSERT(permutation.second);
} }
// 順列 // next permutation
// 範囲の切り出し // from sub range
{ {
SPROUT_STATIC_CONSTEXPR auto permutation = sprout::next_permutation( SPROUT_STATIC_CONSTEXPR auto permutation = sprout::next_permutation(
sprout::sub(arr1, 1, 4) sprout::sub(arr1, 1, 4)
@ -75,7 +75,7 @@ namespace testspr {
{ {
SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 5>{{1, 2, 3, 4, 5}}; SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 5>{{1, 2, 3, 4, 5}};
// 順列 // next permutation
{ {
SPROUT_STATIC_CONSTEXPR auto permutation = sprout::next_permutation( SPROUT_STATIC_CONSTEXPR auto permutation = sprout::next_permutation(
arr1, arr1,
@ -98,8 +98,8 @@ namespace testspr {
)); ));
TESTSPR_BOTH_ASSERT(permutation.second); TESTSPR_BOTH_ASSERT(permutation.second);
} }
// 順列 // next permutation
// 範囲の切り出し // from sub range
{ {
SPROUT_STATIC_CONSTEXPR auto permutation = sprout::next_permutation( SPROUT_STATIC_CONSTEXPR auto permutation = sprout::next_permutation(
sprout::sub(arr1, 1, 4), sprout::sub(arr1, 1, 4),

View file

@ -20,7 +20,7 @@ namespace testspr {
{ {
SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{10, 7, 8, 6, 9, 2, 5, 3, 4, 1}}; SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{10, 7, 8, 6, 9, 2, 5, 3, 4, 1}};
// ソート // sort
{ {
SPROUT_STATIC_CONSTEXPR auto nth = sprout::nth_element( SPROUT_STATIC_CONSTEXPR auto nth = sprout::nth_element(
arr1, arr1,
@ -41,8 +41,8 @@ namespace testspr {
array<int, 5>{{2, 4, 1, 3, 5}} array<int, 5>{{2, 4, 1, 3, 5}}
)); ));
} }
// ソート // sort
// 範囲の切り出し // from sub range
{ {
SPROUT_STATIC_CONSTEXPR auto nth = sprout::nth_element( SPROUT_STATIC_CONSTEXPR auto nth = sprout::nth_element(
sprout::sub(arr1, 2, 8), sprout::sub(arr1, 2, 8),
@ -75,7 +75,7 @@ namespace testspr {
{ {
SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{10, 7, 8, 6, 9, 2, 5, 3, 4, 1}}; SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{10, 7, 8, 6, 9, 2, 5, 3, 4, 1}};
// ソート // sort
{ {
SPROUT_STATIC_CONSTEXPR auto nth = sprout::nth_element( SPROUT_STATIC_CONSTEXPR auto nth = sprout::nth_element(
arr1, arr1,
@ -98,8 +98,8 @@ namespace testspr {
array<int, 5>{{2, 4, 1, 3, 5}} array<int, 5>{{2, 4, 1, 3, 5}}
)); ));
} }
// ソート // sort
// 範囲の切り出し // from sub range
{ {
SPROUT_STATIC_CONSTEXPR auto nth = sprout::nth_element( SPROUT_STATIC_CONSTEXPR auto nth = sprout::nth_element(
sprout::sub(arr1, 2, 8), sprout::sub(arr1, 2, 8),

View file

@ -20,7 +20,7 @@ namespace testspr {
{ {
SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{5, 1, 9, 4, 8, 2, 7, 3, 10, 6}}; SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{5, 1, 9, 4, 8, 2, 7, 3, 10, 6}};
// ソート // sort
{ {
SPROUT_STATIC_CONSTEXPR auto sorted = sprout::partial_sort( SPROUT_STATIC_CONSTEXPR auto sorted = sprout::partial_sort(
arr1, arr1,
@ -41,8 +41,8 @@ namespace testspr {
array<int, 5>{{1, 2, 3, 4, 5}} array<int, 5>{{1, 2, 3, 4, 5}}
)); ));
} }
// ソート // sort
// 範囲の切り出し // from sub range
{ {
SPROUT_STATIC_CONSTEXPR auto sorted = sprout::partial_sort( SPROUT_STATIC_CONSTEXPR auto sorted = sprout::partial_sort(
sprout::sub(arr1, 2, 8), sprout::sub(arr1, 2, 8),
@ -75,7 +75,7 @@ namespace testspr {
{ {
SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{5, 1, 9, 4, 8, 2, 7, 3, 10, 6}}; SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{5, 1, 9, 4, 8, 2, 7, 3, 10, 6}};
// ソート // sort
{ {
SPROUT_STATIC_CONSTEXPR auto sorted = sprout::partial_sort( SPROUT_STATIC_CONSTEXPR auto sorted = sprout::partial_sort(
arr1, arr1,
@ -98,8 +98,8 @@ namespace testspr {
array<int, 5>{{1, 2, 3, 4, 5}} array<int, 5>{{1, 2, 3, 4, 5}}
)); ));
} }
// ソート // sort
// 範囲の切り出し // from sub range
{ {
SPROUT_STATIC_CONSTEXPR auto sorted = sprout::partial_sort( SPROUT_STATIC_CONSTEXPR auto sorted = sprout::partial_sort(
sprout::sub(arr1, 2, 8), sprout::sub(arr1, 2, 8),

View file

@ -20,7 +20,7 @@ namespace testspr {
{ {
SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}}; SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}};
// パーティション (is_odd) // partition (odd)
{ {
SPROUT_STATIC_CONSTEXPR auto partitioned = sprout::partition( SPROUT_STATIC_CONSTEXPR auto partitioned = sprout::partition(
arr1, arr1,
@ -41,8 +41,8 @@ namespace testspr {
array<int, 5>{{9, 7, 5, 3, 1}} array<int, 5>{{9, 7, 5, 3, 1}}
)); ));
} }
// パーティション (is_odd) // partition (odd)
// 範囲の切り出し // from sub range
{ {
SPROUT_STATIC_CONSTEXPR auto partitioned = sprout::partition( SPROUT_STATIC_CONSTEXPR auto partitioned = sprout::partition(
sprout::sub(arr1, 2, 8), sprout::sub(arr1, 2, 8),

View file

@ -22,7 +22,7 @@ namespace testspr {
SPROUT_STATIC_CONSTEXPR auto arr2 = array<int, 10>{{}}; SPROUT_STATIC_CONSTEXPR auto arr2 = array<int, 10>{{}};
SPROUT_STATIC_CONSTEXPR auto arr3 = array<int, 4>{{}}; SPROUT_STATIC_CONSTEXPR auto arr3 = array<int, 4>{{}};
// [2 .. 8) の範囲をパーティション (is_odd) // partition in range [2 .. 8) (odd)
{ {
SPROUT_STATIC_CONSTEXPR auto partitioned = sprout::partition_copy( SPROUT_STATIC_CONSTEXPR auto partitioned = sprout::partition_copy(
sprout::begin(arr1) + 2, sprout::begin(arr1) + 2,
@ -47,8 +47,8 @@ namespace testspr {
array<int, 3>{{7, 5, 3}} array<int, 3>{{7, 5, 3}}
)); ));
} }
// [2 .. 8) の範囲をパーティション (is_odd) // partition in range [2 .. 8) (odd)
// 出力範囲をオーバーする場合 // overrun from output range
{ {
SPROUT_STATIC_CONSTEXPR auto partitioned = sprout::partition_copy( SPROUT_STATIC_CONSTEXPR auto partitioned = sprout::partition_copy(
sprout::begin(arr1) + 2, sprout::begin(arr1) + 2,
@ -73,8 +73,8 @@ namespace testspr {
array<int, 2>{{5, 3}} array<int, 2>{{5, 3}}
)); ));
} }
// [2 .. 8) の範囲をパーティション (is_odd) // partition in range [2 .. 8) (odd)
// 出力範囲の切り出し // to sub range
{ {
SPROUT_STATIC_CONSTEXPR auto partitioned = sprout::partition_copy( SPROUT_STATIC_CONSTEXPR auto partitioned = sprout::partition_copy(
sprout::begin(arr1) + 2, sprout::begin(arr1) + 2,

View file

@ -20,7 +20,7 @@ namespace testspr {
{ {
SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{10, 8, 9, 6, 7, 5, 3, 1, 2, 4}}; SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{10, 8, 9, 6, 7, 5, 3, 1, 2, 4}};
// ヒープからポップ // pop heap
{ {
SPROUT_STATIC_CONSTEXPR auto heap = sprout::pop_heap( SPROUT_STATIC_CONSTEXPR auto heap = sprout::pop_heap(
arr1 arr1
@ -39,8 +39,8 @@ namespace testspr {
array<int, 9>{{9, 8, 5, 6, 7, 4, 3, 1, 2}} array<int, 9>{{9, 8, 5, 6, 7, 4, 3, 1, 2}}
)); ));
} }
// ヒープからポップ // pop heap
// 範囲の切り出し // from sub range
{ {
SPROUT_STATIC_CONSTEXPR auto heap = sprout::pop_heap( SPROUT_STATIC_CONSTEXPR auto heap = sprout::pop_heap(
sprout::sub(arr1, 2, 10) sprout::sub(arr1, 2, 10)

View file

@ -20,7 +20,7 @@ namespace testspr {
{ {
SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 5>{{5, 4, 3, 2, 1}}; SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 5>{{5, 4, 3, 2, 1}};
// 順列 // prev permutation
{ {
SPROUT_STATIC_CONSTEXPR auto permutation = sprout::prev_permutation( SPROUT_STATIC_CONSTEXPR auto permutation = sprout::prev_permutation(
arr1 arr1
@ -41,8 +41,8 @@ namespace testspr {
)); ));
TESTSPR_BOTH_ASSERT(permutation.second); TESTSPR_BOTH_ASSERT(permutation.second);
} }
// 順列 // prev permutation
// 範囲の切り出し // from sub range
{ {
SPROUT_STATIC_CONSTEXPR auto permutation = sprout::prev_permutation( SPROUT_STATIC_CONSTEXPR auto permutation = sprout::prev_permutation(
sprout::sub(arr1, 1, 4) sprout::sub(arr1, 1, 4)
@ -75,7 +75,7 @@ namespace testspr {
{ {
SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 5>{{5, 4, 3, 2, 1}}; SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 5>{{5, 4, 3, 2, 1}};
// 順列 // prev permutation
{ {
SPROUT_STATIC_CONSTEXPR auto permutation = sprout::prev_permutation( SPROUT_STATIC_CONSTEXPR auto permutation = sprout::prev_permutation(
arr1, arr1,
@ -98,8 +98,8 @@ namespace testspr {
)); ));
TESTSPR_BOTH_ASSERT(permutation.second); TESTSPR_BOTH_ASSERT(permutation.second);
} }
// 順列 // prev permutation
// 範囲の切り出し // from sub range
{ {
SPROUT_STATIC_CONSTEXPR auto permutation = sprout::prev_permutation( SPROUT_STATIC_CONSTEXPR auto permutation = sprout::prev_permutation(
sprout::sub(arr1, 1, 4), sprout::sub(arr1, 1, 4),

View file

@ -20,7 +20,7 @@ namespace testspr {
{ {
SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{10, 8, 9, 6, 4, 5, 3, 1, 2, 7}}; SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{10, 8, 9, 6, 4, 5, 3, 1, 2, 7}};
// ヒープにプッシュ // push heap
{ {
SPROUT_STATIC_CONSTEXPR auto heap = sprout::push_heap( SPROUT_STATIC_CONSTEXPR auto heap = sprout::push_heap(
arr1 arr1
@ -39,8 +39,8 @@ namespace testspr {
array<int, 10>{{10, 8, 9, 6, 7, 5, 3, 1, 2, 4}} array<int, 10>{{10, 8, 9, 6, 7, 5, 3, 1, 2, 4}}
)); ));
} }
// ヒープにプッシュ // push heap
// 範囲の切り出し // from sub range
{ {
SPROUT_STATIC_CONSTEXPR auto heap = sprout::push_heap( SPROUT_STATIC_CONSTEXPR auto heap = sprout::push_heap(
sprout::sub(arr1, 2, 10) sprout::sub(arr1, 2, 10)
@ -71,7 +71,7 @@ namespace testspr {
{ {
SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{10, 8, 9, 6, 4, 5, 3, 1, 2, 7}}; SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{10, 8, 9, 6, 4, 5, 3, 1, 2, 7}};
// ヒープにプッシュ // push heap
{ {
SPROUT_STATIC_CONSTEXPR auto heap = sprout::push_heap( SPROUT_STATIC_CONSTEXPR auto heap = sprout::push_heap(
arr1, arr1,
@ -92,8 +92,8 @@ namespace testspr {
array<int, 10>{{10, 8, 9, 6, 7, 5, 3, 1, 2, 4}} array<int, 10>{{10, 8, 9, 6, 7, 5, 3, 1, 2, 4}}
)); ));
} }
// ヒープにプッシュ // push heap
// 範囲の切り出し // from sub range
{ {
SPROUT_STATIC_CONSTEXPR auto heap = sprout::push_heap( SPROUT_STATIC_CONSTEXPR auto heap = sprout::push_heap(
sprout::sub(arr1, 2, 10), sprout::sub(arr1, 2, 10),

View file

@ -22,7 +22,7 @@ namespace testspr {
{ {
SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}}; SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}};
// ランダムスワップ // random swap
{ {
SPROUT_STATIC_CONSTEXPR auto random_swapped = sprout::random_swap( SPROUT_STATIC_CONSTEXPR auto random_swapped = sprout::random_swap(
arr1, arr1,
@ -43,8 +43,8 @@ namespace testspr {
arr1 arr1
)); ));
} }
// ランダムスワップ // random swap
// 範囲の切り出し // from sub range
{ {
SPROUT_STATIC_CONSTEXPR auto random_swapped = sprout::random_swap( SPROUT_STATIC_CONSTEXPR auto random_swapped = sprout::random_swap(
sprout::sub(arr1, 2, 8), sprout::sub(arr1, 2, 8),

View file

@ -23,7 +23,7 @@ namespace testspr {
SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}}; SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}};
SPROUT_STATIC_CONSTEXPR auto g = sprout::random::default_random_engine(SPROUT_UNIQUE_SEED); SPROUT_STATIC_CONSTEXPR auto g = sprout::random::default_random_engine(SPROUT_UNIQUE_SEED);
// ランダムスワップ // random swap
{ {
SPROUT_STATIC_CONSTEXPR auto random_swapped = sprout::random_swap_result( SPROUT_STATIC_CONSTEXPR auto random_swapped = sprout::random_swap_result(
arr1, arr1,
@ -54,8 +54,8 @@ namespace testspr {
); );
TESTSPR_BOTH_ASSERT(sprout::get<1>(random_swapped) == sprout::get<1>(random_swapped2)); TESTSPR_BOTH_ASSERT(sprout::get<1>(random_swapped) == sprout::get<1>(random_swapped2));
} }
// ランダムスワップ // random swap
// 範囲の切り出し // from sub range
{ {
SPROUT_STATIC_CONSTEXPR auto random_swapped = sprout::random_swap_result( SPROUT_STATIC_CONSTEXPR auto random_swapped = sprout::random_swap_result(
sprout::sub(arr1, 2, 8), sprout::sub(arr1, 2, 8),

View file

@ -20,7 +20,7 @@ namespace testspr {
{ {
SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}}; SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}};
// 生成 // generate
{ {
SPROUT_STATIC_CONSTEXPR auto recurrenced = sprout::recurrence( SPROUT_STATIC_CONSTEXPR auto recurrenced = sprout::recurrence(
arr1, arr1,
@ -43,8 +43,8 @@ namespace testspr {
array<int, 10>{{2, 4, 8, 16, 32, 64, 128, 256, 512, 1024}} array<int, 10>{{2, 4, 8, 16, 32, 64, 128, 256, 512, 1024}}
)); ));
} }
// 生成 // generate
// 範囲の切り出し // from sub range
{ {
SPROUT_STATIC_CONSTEXPR auto recurrenced = sprout::recurrence( SPROUT_STATIC_CONSTEXPR auto recurrenced = sprout::recurrence(
sprout::sub(arr1, 2, 8), sprout::sub(arr1, 2, 8),

View file

@ -20,7 +20,7 @@ namespace testspr {
{ {
SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}}; SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}};
// 生成 // generate
{ {
SPROUT_STATIC_CONSTEXPR auto recurrenced = sprout::recurrence_n( SPROUT_STATIC_CONSTEXPR auto recurrenced = sprout::recurrence_n(
arr1, arr1,
@ -45,8 +45,8 @@ namespace testspr {
array<int, 4>{{1, 2, 4, 8}} array<int, 4>{{1, 2, 4, 8}}
)); ));
} }
// 生成 // generate
// 範囲の切り出し // from sub range
{ {
SPROUT_STATIC_CONSTEXPR auto recurrenced = sprout::recurrence_n( SPROUT_STATIC_CONSTEXPR auto recurrenced = sprout::recurrence_n(
sprout::sub(arr1, 2, 8), sprout::sub(arr1, 2, 8),

View file

@ -20,7 +20,7 @@ namespace testspr {
{ {
SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{1, 0, 3, 0, 5, 0, 7, 0, 9, 0}}; SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{1, 0, 3, 0, 5, 0, 7, 0, 9, 0}};
// 削除 (0) // remove (0)
{ {
SPROUT_STATIC_CONSTEXPR auto removed = sprout::remove( SPROUT_STATIC_CONSTEXPR auto removed = sprout::remove(
arr1, arr1,
@ -41,8 +41,8 @@ namespace testspr {
array<int, 5>{{1, 3, 5, 7, 9}} array<int, 5>{{1, 3, 5, 7, 9}}
)); ));
} }
// 削除 (0) // remove (0)
// 範囲の切り出し // from sub range
{ {
SPROUT_STATIC_CONSTEXPR auto removed = sprout::remove( SPROUT_STATIC_CONSTEXPR auto removed = sprout::remove(
sprout::sub(arr1, 2, 8), sprout::sub(arr1, 2, 8),

View file

@ -22,7 +22,7 @@ namespace testspr {
SPROUT_STATIC_CONSTEXPR auto arr2 = array<int, 10>{{}}; SPROUT_STATIC_CONSTEXPR auto arr2 = array<int, 10>{{}};
SPROUT_STATIC_CONSTEXPR auto arr3 = array<int, 2>{{}}; SPROUT_STATIC_CONSTEXPR auto arr3 = array<int, 2>{{}};
// [2 .. 8) の範囲を削除 (0) // remove in range [2 .. 8) (0)
{ {
SPROUT_STATIC_CONSTEXPR auto removed = sprout::remove_copy( SPROUT_STATIC_CONSTEXPR auto removed = sprout::remove_copy(
sprout::begin(arr1) + 2, sprout::begin(arr1) + 2,
@ -47,8 +47,8 @@ namespace testspr {
array<int, 3>{{3, 5, 7}} array<int, 3>{{3, 5, 7}}
)); ));
} }
// [2 .. 8) の範囲を削除 (0) // remove in range [2 .. 8) (0)
// 出力範囲をオーバーする場合 // overrun from output range
{ {
SPROUT_STATIC_CONSTEXPR auto removed = sprout::remove_copy( SPROUT_STATIC_CONSTEXPR auto removed = sprout::remove_copy(
sprout::begin(arr1) + 2, sprout::begin(arr1) + 2,
@ -73,8 +73,8 @@ namespace testspr {
array<int, 2>{{3, 5}} array<int, 2>{{3, 5}}
)); ));
} }
// [2 .. 8) の範囲を削除 (0) // remove in range [2 .. 8) (0)
// 出力範囲の切り出し // to sub range
{ {
SPROUT_STATIC_CONSTEXPR auto removed = sprout::remove_copy( SPROUT_STATIC_CONSTEXPR auto removed = sprout::remove_copy(
sprout::begin(arr1) + 2, sprout::begin(arr1) + 2,

View file

@ -22,7 +22,7 @@ namespace testspr {
SPROUT_STATIC_CONSTEXPR auto arr2 = array<int, 10>{{}}; SPROUT_STATIC_CONSTEXPR auto arr2 = array<int, 10>{{}};
SPROUT_STATIC_CONSTEXPR auto arr3 = array<int, 2>{{}}; SPROUT_STATIC_CONSTEXPR auto arr3 = array<int, 2>{{}};
// [2 .. 8) の範囲を削除 (is_odd) // remove in range [2 .. 8) (odd)
{ {
SPROUT_STATIC_CONSTEXPR auto removed = sprout::remove_copy_if( SPROUT_STATIC_CONSTEXPR auto removed = sprout::remove_copy_if(
sprout::begin(arr1) + 2, sprout::begin(arr1) + 2,
@ -47,8 +47,8 @@ namespace testspr {
array<int, 3>{{0, 0, 0}} array<int, 3>{{0, 0, 0}}
)); ));
} }
// [2 .. 8) の範囲を削除 (is_odd) // remove in range [2 .. 8) (odd)
// 出力範囲をオーバーする場合 // overrun from output range
{ {
SPROUT_STATIC_CONSTEXPR auto removed = sprout::remove_copy_if( SPROUT_STATIC_CONSTEXPR auto removed = sprout::remove_copy_if(
sprout::begin(arr1) + 2, sprout::begin(arr1) + 2,
@ -73,8 +73,8 @@ namespace testspr {
array<int, 2>{{0, 0}} array<int, 2>{{0, 0}}
)); ));
} }
// [2 .. 8) の範囲を削除 (is_odd) // remove in range [2 .. 8) (odd)
// 出力範囲の切り出し // to sub range
{ {
SPROUT_STATIC_CONSTEXPR auto removed = sprout::remove_copy_if( SPROUT_STATIC_CONSTEXPR auto removed = sprout::remove_copy_if(
sprout::begin(arr1) + 2, sprout::begin(arr1) + 2,

View file

@ -20,7 +20,7 @@ namespace testspr {
{ {
SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{1, 0, 3, 0, 5, 0, 7, 0, 9, 0}}; SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{1, 0, 3, 0, 5, 0, 7, 0, 9, 0}};
// 削除 (is_odd) // remove (odd)
{ {
SPROUT_STATIC_CONSTEXPR auto removed = sprout::remove_if( SPROUT_STATIC_CONSTEXPR auto removed = sprout::remove_if(
arr1, arr1,
@ -41,8 +41,8 @@ namespace testspr {
array<int, 5>{{0, 0, 0, 0, 0}} array<int, 5>{{0, 0, 0, 0, 0}}
)); ));
} }
// 削除 (is_odd) // remove (odd)
// 範囲の切り出し // from sub range
{ {
SPROUT_STATIC_CONSTEXPR auto removed = sprout::remove_if( SPROUT_STATIC_CONSTEXPR auto removed = sprout::remove_if(
sprout::sub(arr1, 2, 8), sprout::sub(arr1, 2, 8),

View file

@ -20,7 +20,7 @@ namespace testspr {
{ {
SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{1, 0, 3, 0, 5, 0, 7, 0, 9, 0}}; SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{1, 0, 3, 0, 5, 0, 7, 0, 9, 0}};
// 置換 (0 -> -1) // replace (0 -> -1)
{ {
SPROUT_STATIC_CONSTEXPR auto replaced = sprout::replace( SPROUT_STATIC_CONSTEXPR auto replaced = sprout::replace(
arr1, arr1,
@ -43,8 +43,8 @@ namespace testspr {
array<int, 10>{{1, -1, 3, -1, 5, -1, 7, -1, 9, -1}} array<int, 10>{{1, -1, 3, -1, 5, -1, 7, -1, 9, -1}}
)); ));
} }
// 置換 (0 -> -1) // replace (0 -> -1)
// 範囲の切り出し // from sub range
{ {
SPROUT_STATIC_CONSTEXPR auto replaced = sprout::replace( SPROUT_STATIC_CONSTEXPR auto replaced = sprout::replace(
sprout::sub(arr1, 2, 8), sprout::sub(arr1, 2, 8),

View file

@ -22,7 +22,7 @@ namespace testspr {
SPROUT_STATIC_CONSTEXPR auto arr2 = array<int, 10>{{}}; SPROUT_STATIC_CONSTEXPR auto arr2 = array<int, 10>{{}};
SPROUT_STATIC_CONSTEXPR auto arr3 = array<int, 4>{{}}; SPROUT_STATIC_CONSTEXPR auto arr3 = array<int, 4>{{}};
// [2 .. 8) の範囲を置換 (0 -> -1) // replace in range [2 .. 8) (0 -> -1)
{ {
SPROUT_STATIC_CONSTEXPR auto replaced = sprout::replace_copy( SPROUT_STATIC_CONSTEXPR auto replaced = sprout::replace_copy(
sprout::begin(arr1) + 2, sprout::begin(arr1) + 2,
@ -49,8 +49,8 @@ namespace testspr {
array<int, 6>{{3, -1, 5, -1, 7, -1}} array<int, 6>{{3, -1, 5, -1, 7, -1}}
)); ));
} }
// [2 .. 8) の範囲を置換 (0 -> -1) // replace in range [2 .. 8) (0 -> -1)
// 出力範囲をオーバーする場合 // overrun from output range
{ {
SPROUT_STATIC_CONSTEXPR auto replaced = sprout::replace_copy( SPROUT_STATIC_CONSTEXPR auto replaced = sprout::replace_copy(
sprout::begin(arr1) + 2, sprout::begin(arr1) + 2,
@ -77,8 +77,8 @@ namespace testspr {
array<int, 4>{{3, -1, 5, -1}} array<int, 4>{{3, -1, 5, -1}}
)); ));
} }
// [2 .. 8) の範囲を置換 (0 -> -1) // replace in range [2 .. 8) (0 -> -1)
// 出力範囲の切り出し // to sub range
{ {
SPROUT_STATIC_CONSTEXPR auto replaced = sprout::replace_copy( SPROUT_STATIC_CONSTEXPR auto replaced = sprout::replace_copy(
sprout::begin(arr1) + 2, sprout::begin(arr1) + 2,

View file

@ -22,7 +22,7 @@ namespace testspr {
SPROUT_STATIC_CONSTEXPR auto arr2 = array<int, 10>{{}}; SPROUT_STATIC_CONSTEXPR auto arr2 = array<int, 10>{{}};
SPROUT_STATIC_CONSTEXPR auto arr3 = array<int, 4>{{}}; SPROUT_STATIC_CONSTEXPR auto arr3 = array<int, 4>{{}};
// [2 .. 8) の範囲を置換 (is_odd -> -1) // replace in range [2 .. 8) (odd -> -1)
{ {
SPROUT_STATIC_CONSTEXPR auto replaced = sprout::replace_copy_if( SPROUT_STATIC_CONSTEXPR auto replaced = sprout::replace_copy_if(
sprout::begin(arr1) + 2, sprout::begin(arr1) + 2,
@ -49,8 +49,8 @@ namespace testspr {
array<int, 6>{{-1, 0, -1, 0, -1, 0}} array<int, 6>{{-1, 0, -1, 0, -1, 0}}
)); ));
} }
// [2 .. 8) の範囲を置換 (is_odd -> -1) // replace in range [2 .. 8) (odd -> -1)
// 出力範囲をオーバーする場合 // overrun from output range
{ {
SPROUT_STATIC_CONSTEXPR auto replaced = sprout::replace_copy_if( SPROUT_STATIC_CONSTEXPR auto replaced = sprout::replace_copy_if(
sprout::begin(arr1) + 2, sprout::begin(arr1) + 2,
@ -77,8 +77,8 @@ namespace testspr {
array<int, 4>{{-1, 0, -1, 0}} array<int, 4>{{-1, 0, -1, 0}}
)); ));
} }
// [2 .. 8) の範囲を置換 (is_odd -> -1) // replace in range [2 .. 8) (odd -> -1)
// 出力範囲の切り出し // to sub range
{ {
SPROUT_STATIC_CONSTEXPR auto replaced = sprout::replace_copy_if( SPROUT_STATIC_CONSTEXPR auto replaced = sprout::replace_copy_if(
sprout::begin(arr1) + 2, sprout::begin(arr1) + 2,

View file

@ -20,7 +20,7 @@ namespace testspr {
{ {
SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{1, 0, 3, 0, 5, 0, 7, 0, 9, 0}}; SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{1, 0, 3, 0, 5, 0, 7, 0, 9, 0}};
// 置換 (is_odd -> -1) // replace (odd -> -1)
{ {
SPROUT_STATIC_CONSTEXPR auto replaced = sprout::replace_if( SPROUT_STATIC_CONSTEXPR auto replaced = sprout::replace_if(
arr1, arr1,
@ -43,8 +43,8 @@ namespace testspr {
array<int, 10>{{-1, 0, -1, 0, -1, 0, -1, 0, -1, 0}} array<int, 10>{{-1, 0, -1, 0, -1, 0, -1, 0, -1, 0}}
)); ));
} }
// 置換 (is_odd -> -1) // replace (odd -> -1)
// 範囲の切り出し // from sub range
{ {
SPROUT_STATIC_CONSTEXPR auto replaced = sprout::replace_if( SPROUT_STATIC_CONSTEXPR auto replaced = sprout::replace_if(
sprout::sub(arr1, 2, 8), sprout::sub(arr1, 2, 8),

View file

@ -20,7 +20,7 @@ namespace testspr {
{ {
SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}}; SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}};
// 反転 // reverse
{ {
SPROUT_STATIC_CONSTEXPR auto reversed = sprout::reverse( SPROUT_STATIC_CONSTEXPR auto reversed = sprout::reverse(
arr1 arr1
@ -39,8 +39,8 @@ namespace testspr {
array<int, 10>{{10, 9, 8, 7, 6, 5, 4, 3, 2, 1}} array<int, 10>{{10, 9, 8, 7, 6, 5, 4, 3, 2, 1}}
)); ));
} }
// 反転 // reverse
// 範囲の切り出し // from sub range
{ {
SPROUT_STATIC_CONSTEXPR auto reversed = sprout::reverse( SPROUT_STATIC_CONSTEXPR auto reversed = sprout::reverse(
sprout::sub(arr1, 2, 8) sprout::sub(arr1, 2, 8)

View file

@ -22,7 +22,7 @@ namespace testspr {
SPROUT_STATIC_CONSTEXPR auto arr2 = array<int, 10>{{}}; SPROUT_STATIC_CONSTEXPR auto arr2 = array<int, 10>{{}};
SPROUT_STATIC_CONSTEXPR auto arr3 = array<int, 4>{{}}; SPROUT_STATIC_CONSTEXPR auto arr3 = array<int, 4>{{}};
// [2 .. 8) の範囲を反転 // reverse in range [2 .. 8)
{ {
SPROUT_STATIC_CONSTEXPR auto reversed = sprout::reverse_copy( SPROUT_STATIC_CONSTEXPR auto reversed = sprout::reverse_copy(
sprout::begin(arr1) + 2, sprout::begin(arr1) + 2,
@ -45,8 +45,8 @@ namespace testspr {
array<int, 6>{{8, 7, 6, 5, 4, 3}} array<int, 6>{{8, 7, 6, 5, 4, 3}}
)); ));
} }
// [2 .. 8) の範囲を反転 // reverse in range [2 .. 8)
// 出力範囲をオーバーする場合 // overrun from output range
{ {
SPROUT_STATIC_CONSTEXPR auto reversed = sprout::reverse_copy( SPROUT_STATIC_CONSTEXPR auto reversed = sprout::reverse_copy(
sprout::begin(arr1) + 2, sprout::begin(arr1) + 2,
@ -69,8 +69,8 @@ namespace testspr {
array<int, 4>{{8, 7, 6, 5}} array<int, 4>{{8, 7, 6, 5}}
)); ));
} }
// [2 .. 8) の範囲を反転 // reverse in range [2 .. 8)
// 出力範囲の切り出し // to sub range
{ {
SPROUT_STATIC_CONSTEXPR auto reversed = sprout::reverse_copy( SPROUT_STATIC_CONSTEXPR auto reversed = sprout::reverse_copy(
sprout::begin(arr1) + 2, sprout::begin(arr1) + 2,

View file

@ -20,7 +20,7 @@ namespace testspr {
{ {
SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}}; SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}};
// 回転 // rotate
{ {
SPROUT_STATIC_CONSTEXPR auto rotated = sprout::rotate( SPROUT_STATIC_CONSTEXPR auto rotated = sprout::rotate(
arr1, arr1,
@ -41,8 +41,8 @@ namespace testspr {
array<int, 10>{{6, 7, 8, 9, 10, 1, 2, 3, 4, 5}} array<int, 10>{{6, 7, 8, 9, 10, 1, 2, 3, 4, 5}}
)); ));
} }
// 回転 // rotate
// 範囲の切り出し // from sub range
{ {
SPROUT_STATIC_CONSTEXPR auto rotated = sprout::rotate( SPROUT_STATIC_CONSTEXPR auto rotated = sprout::rotate(
sprout::sub(arr1, 2, 8), sprout::sub(arr1, 2, 8),

View file

@ -22,7 +22,7 @@ namespace testspr {
SPROUT_STATIC_CONSTEXPR auto arr2 = array<int, 10>{{}}; SPROUT_STATIC_CONSTEXPR auto arr2 = array<int, 10>{{}};
SPROUT_STATIC_CONSTEXPR auto arr3 = array<int, 4>{{}}; SPROUT_STATIC_CONSTEXPR auto arr3 = array<int, 4>{{}};
// [2 .. 8) の範囲を回転 // rotate in range [2 .. 8)
{ {
SPROUT_STATIC_CONSTEXPR auto rotated = sprout::rotate_copy( SPROUT_STATIC_CONSTEXPR auto rotated = sprout::rotate_copy(
sprout::begin(arr1) + 2, sprout::begin(arr1) + 2,
@ -47,8 +47,8 @@ namespace testspr {
array<int, 6>{{6, 7, 8, 3, 4, 5}} array<int, 6>{{6, 7, 8, 3, 4, 5}}
)); ));
} }
// [2 .. 8) の範囲を回転 // rotate in range [2 .. 8)
// 出力範囲をオーバーする場合 // overrun from output range
{ {
SPROUT_STATIC_CONSTEXPR auto rotated = sprout::rotate_copy( SPROUT_STATIC_CONSTEXPR auto rotated = sprout::rotate_copy(
sprout::begin(arr1) + 2, sprout::begin(arr1) + 2,
@ -73,8 +73,8 @@ namespace testspr {
array<int, 4>{{6, 7, 8, 3}} array<int, 4>{{6, 7, 8, 3}}
)); ));
} }
// [2 .. 8) の範囲を回転 // rotate in range [2 .. 8)
// 出力範囲の切り出し // to sub range
{ {
SPROUT_STATIC_CONSTEXPR auto rotated = sprout::rotate_copy( SPROUT_STATIC_CONSTEXPR auto rotated = sprout::rotate_copy(
sprout::begin(arr1) + 2, sprout::begin(arr1) + 2,

View file

@ -23,7 +23,7 @@ namespace testspr {
SPROUT_STATIC_CONSTEXPR auto arr2 = array<int, 10>{{}}; SPROUT_STATIC_CONSTEXPR auto arr2 = array<int, 10>{{}};
SPROUT_STATIC_CONSTEXPR auto arr3 = array<int, 2>{{}}; SPROUT_STATIC_CONSTEXPR auto arr3 = array<int, 2>{{}};
// 論理差 // difference
{ {
SPROUT_STATIC_CONSTEXPR auto merged = sprout::set_difference( SPROUT_STATIC_CONSTEXPR auto merged = sprout::set_difference(
sprout::begin(arr1), sprout::begin(arr1),
@ -50,8 +50,8 @@ namespace testspr {
array<int, 3>{{5, 15, 25}} array<int, 3>{{5, 15, 25}}
)); ));
} }
// 論理差 // difference
// 出力範囲をオーバーする場合 // overrun from output range
{ {
SPROUT_STATIC_CONSTEXPR auto merged = sprout::set_difference( SPROUT_STATIC_CONSTEXPR auto merged = sprout::set_difference(
sprout::begin(arr1), sprout::begin(arr1),
@ -78,8 +78,8 @@ namespace testspr {
array<int, 2>{{5, 15}} array<int, 2>{{5, 15}}
)); ));
} }
// 論理差 // difference
// 出力範囲の切り出し // to sub range
{ {
SPROUT_STATIC_CONSTEXPR auto merged = sprout::set_difference( SPROUT_STATIC_CONSTEXPR auto merged = sprout::set_difference(
sprout::begin(arr1), sprout::begin(arr1),
@ -121,7 +121,7 @@ namespace testspr {
SPROUT_STATIC_CONSTEXPR auto arr2 = array<int, 10>{{}}; SPROUT_STATIC_CONSTEXPR auto arr2 = array<int, 10>{{}};
SPROUT_STATIC_CONSTEXPR auto arr3 = array<int, 2>{{}}; SPROUT_STATIC_CONSTEXPR auto arr3 = array<int, 2>{{}};
// 論理差 // difference
{ {
SPROUT_STATIC_CONSTEXPR auto merged = sprout::set_difference( SPROUT_STATIC_CONSTEXPR auto merged = sprout::set_difference(
sprout::begin(arr1), sprout::begin(arr1),
@ -150,8 +150,8 @@ namespace testspr {
array<int, 3>{{5, 15, 25}} array<int, 3>{{5, 15, 25}}
)); ));
} }
// 論理差 // difference
// 出力範囲をオーバーする場合 // overrun from output range
{ {
SPROUT_STATIC_CONSTEXPR auto merged = sprout::set_difference( SPROUT_STATIC_CONSTEXPR auto merged = sprout::set_difference(
sprout::begin(arr1), sprout::begin(arr1),
@ -180,8 +180,8 @@ namespace testspr {
array<int, 2>{{5, 15}} array<int, 2>{{5, 15}}
)); ));
} }
// 論理差 // difference
// 出力範囲の切り出し // to sub range
{ {
SPROUT_STATIC_CONSTEXPR auto merged = sprout::set_difference( SPROUT_STATIC_CONSTEXPR auto merged = sprout::set_difference(
sprout::begin(arr1), sprout::begin(arr1),

View file

@ -23,7 +23,7 @@ namespace testspr {
SPROUT_STATIC_CONSTEXPR auto arr2 = array<int, 10>{{}}; SPROUT_STATIC_CONSTEXPR auto arr2 = array<int, 10>{{}};
SPROUT_STATIC_CONSTEXPR auto arr3 = array<int, 2>{{}}; SPROUT_STATIC_CONSTEXPR auto arr3 = array<int, 2>{{}};
// 論理積 // intersection
{ {
SPROUT_STATIC_CONSTEXPR auto merged = sprout::set_intersection( SPROUT_STATIC_CONSTEXPR auto merged = sprout::set_intersection(
sprout::begin(arr1), sprout::begin(arr1),
@ -50,8 +50,8 @@ namespace testspr {
array<int, 3>{{20, 30, 40}} array<int, 3>{{20, 30, 40}}
)); ));
} }
// 論理積 // intersection
// 出力範囲をオーバーする場合 // overrun from output range
{ {
SPROUT_STATIC_CONSTEXPR auto merged = sprout::set_intersection( SPROUT_STATIC_CONSTEXPR auto merged = sprout::set_intersection(
sprout::begin(arr1), sprout::begin(arr1),
@ -78,8 +78,8 @@ namespace testspr {
array<int, 2>{{20, 30}} array<int, 2>{{20, 30}}
)); ));
} }
// 論理積 // intersection
// 出力範囲の切り出し // to sub range
{ {
SPROUT_STATIC_CONSTEXPR auto merged = sprout::set_intersection( SPROUT_STATIC_CONSTEXPR auto merged = sprout::set_intersection(
sprout::begin(arr1), sprout::begin(arr1),
@ -121,7 +121,7 @@ namespace testspr {
SPROUT_STATIC_CONSTEXPR auto arr2 = array<int, 10>{{}}; SPROUT_STATIC_CONSTEXPR auto arr2 = array<int, 10>{{}};
SPROUT_STATIC_CONSTEXPR auto arr3 = array<int, 2>{{}}; SPROUT_STATIC_CONSTEXPR auto arr3 = array<int, 2>{{}};
// 論理積 // intersection
{ {
SPROUT_STATIC_CONSTEXPR auto merged = sprout::set_intersection( SPROUT_STATIC_CONSTEXPR auto merged = sprout::set_intersection(
sprout::begin(arr1), sprout::begin(arr1),
@ -150,8 +150,8 @@ namespace testspr {
array<int, 3>{{20, 30, 40}} array<int, 3>{{20, 30, 40}}
)); ));
} }
// 論理積 // intersection
// 出力範囲をオーバーする場合 // overrun from output range
{ {
SPROUT_STATIC_CONSTEXPR auto merged = sprout::set_intersection( SPROUT_STATIC_CONSTEXPR auto merged = sprout::set_intersection(
sprout::begin(arr1), sprout::begin(arr1),
@ -180,8 +180,8 @@ namespace testspr {
array<int, 2>{{20, 30}} array<int, 2>{{20, 30}}
)); ));
} }
// 論理積 // intersection
// 出力範囲の切り出し // to sub range
{ {
SPROUT_STATIC_CONSTEXPR auto merged = sprout::set_intersection( SPROUT_STATIC_CONSTEXPR auto merged = sprout::set_intersection(
sprout::begin(arr1), sprout::begin(arr1),

View file

@ -23,7 +23,7 @@ namespace testspr {
SPROUT_STATIC_CONSTEXPR auto arr2 = array<int, 10>{{}}; SPROUT_STATIC_CONSTEXPR auto arr2 = array<int, 10>{{}};
SPROUT_STATIC_CONSTEXPR auto arr3 = array<int, 4>{{}}; SPROUT_STATIC_CONSTEXPR auto arr3 = array<int, 4>{{}};
// 排他的論理和 // symmetric difference
{ {
SPROUT_STATIC_CONSTEXPR auto merged = sprout::set_symmetric_difference( SPROUT_STATIC_CONSTEXPR auto merged = sprout::set_symmetric_difference(
sprout::begin(arr1), sprout::begin(arr1),
@ -50,8 +50,8 @@ namespace testspr {
array<int, 6>{{5, 15, 25, 30, 40, 50}} array<int, 6>{{5, 15, 25, 30, 40, 50}}
)); ));
} }
// 排他的論理和 // symmetric difference
// 出力範囲をオーバーする場合 // overrun from output range
{ {
SPROUT_STATIC_CONSTEXPR auto merged = sprout::set_symmetric_difference( SPROUT_STATIC_CONSTEXPR auto merged = sprout::set_symmetric_difference(
sprout::begin(arr1), sprout::begin(arr1),
@ -78,8 +78,8 @@ namespace testspr {
array<int, 4>{{5, 15, 25, 30}} array<int, 4>{{5, 15, 25, 30}}
)); ));
} }
// 排他的論理和 // symmetric difference
// 出力範囲の切り出し // to sub range
{ {
SPROUT_STATIC_CONSTEXPR auto merged = sprout::set_symmetric_difference( SPROUT_STATIC_CONSTEXPR auto merged = sprout::set_symmetric_difference(
sprout::begin(arr1), sprout::begin(arr1),
@ -121,7 +121,7 @@ namespace testspr {
SPROUT_STATIC_CONSTEXPR auto arr2 = array<int, 10>{{}}; SPROUT_STATIC_CONSTEXPR auto arr2 = array<int, 10>{{}};
SPROUT_STATIC_CONSTEXPR auto arr3 = array<int, 4>{{}}; SPROUT_STATIC_CONSTEXPR auto arr3 = array<int, 4>{{}};
// 排他的論理和 // symmetric difference
{ {
SPROUT_STATIC_CONSTEXPR auto merged = sprout::set_symmetric_difference( SPROUT_STATIC_CONSTEXPR auto merged = sprout::set_symmetric_difference(
sprout::begin(arr1), sprout::begin(arr1),
@ -150,8 +150,8 @@ namespace testspr {
array<int, 6>{{5, 15, 25, 30, 40, 50}} array<int, 6>{{5, 15, 25, 30, 40, 50}}
)); ));
} }
// 排他的論理和 // symmetric difference
// 出力範囲をオーバーする場合 // overrun from output range
{ {
SPROUT_STATIC_CONSTEXPR auto merged = sprout::set_symmetric_difference( SPROUT_STATIC_CONSTEXPR auto merged = sprout::set_symmetric_difference(
sprout::begin(arr1), sprout::begin(arr1),
@ -180,8 +180,8 @@ namespace testspr {
array<int, 4>{{5, 15, 25, 30}} array<int, 4>{{5, 15, 25, 30}}
)); ));
} }
// 排他的論理和 // symmetric difference
// 出力範囲の切り出し // to sub range
{ {
SPROUT_STATIC_CONSTEXPR auto merged = sprout::set_symmetric_difference( SPROUT_STATIC_CONSTEXPR auto merged = sprout::set_symmetric_difference(
sprout::begin(arr1), sprout::begin(arr1),

View file

@ -23,7 +23,7 @@ namespace testspr {
SPROUT_STATIC_CONSTEXPR auto arr2 = array<int, 10>{{}}; SPROUT_STATIC_CONSTEXPR auto arr2 = array<int, 10>{{}};
SPROUT_STATIC_CONSTEXPR auto arr3 = array<int, 4>{{}}; SPROUT_STATIC_CONSTEXPR auto arr3 = array<int, 4>{{}};
// 論理和 // union
{ {
SPROUT_STATIC_CONSTEXPR auto merged = sprout::set_union( SPROUT_STATIC_CONSTEXPR auto merged = sprout::set_union(
sprout::begin(arr1), sprout::begin(arr1),
@ -50,8 +50,8 @@ namespace testspr {
array<int, 8>{{5, 10, 15, 20, 25, 30, 40, 50}} array<int, 8>{{5, 10, 15, 20, 25, 30, 40, 50}}
)); ));
} }
// 論理和 // union
// 出力範囲をオーバーする場合 // overrun from output range
{ {
SPROUT_STATIC_CONSTEXPR auto merged = sprout::set_union( SPROUT_STATIC_CONSTEXPR auto merged = sprout::set_union(
sprout::begin(arr1), sprout::begin(arr1),
@ -78,8 +78,8 @@ namespace testspr {
array<int, 4>{{5, 10, 15, 20}} array<int, 4>{{5, 10, 15, 20}}
)); ));
} }
// 論理和 // union
// 出力範囲の切り出し // to sub range
{ {
SPROUT_STATIC_CONSTEXPR auto merged = sprout::set_union( SPROUT_STATIC_CONSTEXPR auto merged = sprout::set_union(
sprout::begin(arr1), sprout::begin(arr1),
@ -121,7 +121,7 @@ namespace testspr {
SPROUT_STATIC_CONSTEXPR auto arr2 = array<int, 10>{{}}; SPROUT_STATIC_CONSTEXPR auto arr2 = array<int, 10>{{}};
SPROUT_STATIC_CONSTEXPR auto arr3 = array<int, 4>{{}}; SPROUT_STATIC_CONSTEXPR auto arr3 = array<int, 4>{{}};
// 論理和 // union
{ {
SPROUT_STATIC_CONSTEXPR auto merged = sprout::set_union( SPROUT_STATIC_CONSTEXPR auto merged = sprout::set_union(
sprout::begin(arr1), sprout::begin(arr1),
@ -150,8 +150,8 @@ namespace testspr {
array<int, 8>{{5, 10, 15, 20, 25, 30, 40, 50}} array<int, 8>{{5, 10, 15, 20, 25, 30, 40, 50}}
)); ));
} }
// 論理和 // union
// 出力範囲をオーバーする場合 // overrun from output range
{ {
SPROUT_STATIC_CONSTEXPR auto merged = sprout::set_union( SPROUT_STATIC_CONSTEXPR auto merged = sprout::set_union(
sprout::begin(arr1), sprout::begin(arr1),
@ -180,8 +180,8 @@ namespace testspr {
array<int, 4>{{5, 10, 15, 20}} array<int, 4>{{5, 10, 15, 20}}
)); ));
} }
// 論理和 // union
// 出力範囲の切り出し // to sub range
{ {
SPROUT_STATIC_CONSTEXPR auto merged = sprout::set_union( SPROUT_STATIC_CONSTEXPR auto merged = sprout::set_union(
sprout::begin(arr1), sprout::begin(arr1),

View file

@ -22,7 +22,7 @@ namespace testspr {
{ {
SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}}; SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}};
// シャッフル // shuffle
{ {
SPROUT_STATIC_CONSTEXPR auto shuffled = sprout::shuffle( SPROUT_STATIC_CONSTEXPR auto shuffled = sprout::shuffle(
arr1, arr1,
@ -43,8 +43,8 @@ namespace testspr {
arr1 arr1
)); ));
} }
// シャッフル // shuffle
// 範囲の切り出し // from sub range
{ {
SPROUT_STATIC_CONSTEXPR auto shuffled = sprout::shuffle( SPROUT_STATIC_CONSTEXPR auto shuffled = sprout::shuffle(
sprout::sub(arr1, 2, 8), sprout::sub(arr1, 2, 8),

View file

@ -23,7 +23,7 @@ namespace testspr {
SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}}; SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}};
SPROUT_STATIC_CONSTEXPR auto g = sprout::random::default_random_engine(SPROUT_UNIQUE_SEED); SPROUT_STATIC_CONSTEXPR auto g = sprout::random::default_random_engine(SPROUT_UNIQUE_SEED);
// シャッフル // shuffle
{ {
SPROUT_STATIC_CONSTEXPR auto shuffled = sprout::shuffle_result( SPROUT_STATIC_CONSTEXPR auto shuffled = sprout::shuffle_result(
arr1, arr1,
@ -54,8 +54,8 @@ namespace testspr {
); );
TESTSPR_BOTH_ASSERT(sprout::get<1>(shuffled) == sprout::get<1>(shuffled2)); TESTSPR_BOTH_ASSERT(sprout::get<1>(shuffled) == sprout::get<1>(shuffled2));
} }
// シャッフル // shuffle
// 範囲の切り出し // from sub range
{ {
SPROUT_STATIC_CONSTEXPR auto shuffled = sprout::shuffle_result( SPROUT_STATIC_CONSTEXPR auto shuffled = sprout::shuffle_result(
sprout::sub(arr1, 2, 8), sprout::sub(arr1, 2, 8),

View file

@ -20,7 +20,7 @@ namespace testspr {
{ {
SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{5, 1, 9, 4, 8, 2, 7, 3, 10, 6}}; SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{5, 1, 9, 4, 8, 2, 7, 3, 10, 6}};
// ソート // sort
{ {
SPROUT_STATIC_CONSTEXPR auto sorted = sprout::sort( SPROUT_STATIC_CONSTEXPR auto sorted = sprout::sort(
arr1 arr1
@ -39,8 +39,8 @@ namespace testspr {
array<int, 10>{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}} array<int, 10>{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}}
)); ));
} }
// ソート // sort
// 範囲の切り出し // from sub range
{ {
SPROUT_STATIC_CONSTEXPR auto sorted = sprout::sort( SPROUT_STATIC_CONSTEXPR auto sorted = sprout::sort(
sprout::sub(arr1, 2, 8) sprout::sub(arr1, 2, 8)
@ -71,7 +71,7 @@ namespace testspr {
{ {
SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{5, 1, 9, 4, 8, 2, 7, 3, 10, 6}}; SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{5, 1, 9, 4, 8, 2, 7, 3, 10, 6}};
// ソート // sort
{ {
SPROUT_STATIC_CONSTEXPR auto sorted = sprout::sort( SPROUT_STATIC_CONSTEXPR auto sorted = sprout::sort(
arr1, arr1,
@ -92,8 +92,8 @@ namespace testspr {
array<int, 10>{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}} array<int, 10>{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}}
)); ));
} }
// ソート // sort
// 範囲の切り出し // from sub range
{ {
SPROUT_STATIC_CONSTEXPR auto sorted = sprout::sort( SPROUT_STATIC_CONSTEXPR auto sorted = sprout::sort(
sprout::sub(arr1, 2, 8), sprout::sub(arr1, 2, 8),

View file

@ -20,7 +20,7 @@ namespace testspr {
{ {
SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{10, 9, 8, 6, 7, 2, 5, 3, 4, 1}}; SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{10, 9, 8, 6, 7, 2, 5, 3, 4, 1}};
// ソート // sort
{ {
SPROUT_STATIC_CONSTEXPR auto sorted = sprout::sort_heap( SPROUT_STATIC_CONSTEXPR auto sorted = sprout::sort_heap(
arr1 arr1
@ -39,8 +39,8 @@ namespace testspr {
array<int, 10>{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}} array<int, 10>{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}}
)); ));
} }
// ソート // sort
// 範囲の切り出し // from sub range
{ {
SPROUT_STATIC_CONSTEXPR auto sorted = sprout::sort_heap( SPROUT_STATIC_CONSTEXPR auto sorted = sprout::sort_heap(
sprout::sub(arr1, 2, 8) sprout::sub(arr1, 2, 8)
@ -71,7 +71,7 @@ namespace testspr {
{ {
SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{10, 9, 8, 6, 7, 2, 5, 3, 4, 1}}; SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{10, 9, 8, 6, 7, 2, 5, 3, 4, 1}};
// ソート // sort
{ {
SPROUT_STATIC_CONSTEXPR auto sorted = sprout::sort_heap( SPROUT_STATIC_CONSTEXPR auto sorted = sprout::sort_heap(
arr1, arr1,
@ -92,8 +92,8 @@ namespace testspr {
array<int, 10>{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}} array<int, 10>{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}}
)); ));
} }
// ソート // sort
// 範囲の切り出し // from sub range
{ {
SPROUT_STATIC_CONSTEXPR auto sorted = sprout::sort_heap( SPROUT_STATIC_CONSTEXPR auto sorted = sprout::sort_heap(
sprout::sub(arr1, 2, 8), sprout::sub(arr1, 2, 8),

View file

@ -20,7 +20,7 @@ namespace testspr {
{ {
SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}}; SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}};
// パーティション (is_odd) // partition (odd)
{ {
SPROUT_STATIC_CONSTEXPR auto partitioned = sprout::stable_partition( SPROUT_STATIC_CONSTEXPR auto partitioned = sprout::stable_partition(
arr1, arr1,
@ -41,8 +41,8 @@ namespace testspr {
array<int, 5>{{1, 3, 5, 7, 9}} array<int, 5>{{1, 3, 5, 7, 9}}
)); ));
} }
// パーティション (is_odd) // partition (odd)
// 範囲の切り出し // from sub range
{ {
SPROUT_STATIC_CONSTEXPR auto partitioned = sprout::stable_partition( SPROUT_STATIC_CONSTEXPR auto partitioned = sprout::stable_partition(
sprout::sub(arr1, 2, 8), sprout::sub(arr1, 2, 8),

View file

@ -22,7 +22,7 @@ namespace testspr {
SPROUT_STATIC_CONSTEXPR auto arr2 = array<int, 10>{{}}; SPROUT_STATIC_CONSTEXPR auto arr2 = array<int, 10>{{}};
SPROUT_STATIC_CONSTEXPR auto arr3 = array<int, 4>{{}}; SPROUT_STATIC_CONSTEXPR auto arr3 = array<int, 4>{{}};
// [2 .. 8) の範囲をパーティション (is_odd) // partition in range [2 .. 8) (odd)
{ {
SPROUT_STATIC_CONSTEXPR auto partitioned = sprout::stable_partition_copy( SPROUT_STATIC_CONSTEXPR auto partitioned = sprout::stable_partition_copy(
sprout::begin(arr1) + 2, sprout::begin(arr1) + 2,
@ -47,8 +47,8 @@ namespace testspr {
array<int, 3>{{3, 5, 7}} array<int, 3>{{3, 5, 7}}
)); ));
} }
// [2 .. 8) の範囲をパーティション (is_odd) // partition in range [2 .. 8) (odd)
// 出力範囲をオーバーする場合 // overrun from output range
{ {
SPROUT_STATIC_CONSTEXPR auto partitioned = sprout::stable_partition_copy( SPROUT_STATIC_CONSTEXPR auto partitioned = sprout::stable_partition_copy(
sprout::begin(arr1) + 2, sprout::begin(arr1) + 2,
@ -73,8 +73,8 @@ namespace testspr {
array<int, 3>{{3, 5, 7}} array<int, 3>{{3, 5, 7}}
)); ));
} }
// [2 .. 8) の範囲をパーティション (is_odd) // partition in range [2 .. 8) (odd)
// 出力範囲の切り出し // to sub range
{ {
SPROUT_STATIC_CONSTEXPR auto partitioned = sprout::stable_partition_copy( SPROUT_STATIC_CONSTEXPR auto partitioned = sprout::stable_partition_copy(
sprout::begin(arr1) + 2, sprout::begin(arr1) + 2,

View file

@ -20,7 +20,7 @@ namespace testspr {
{ {
SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{5, 1, 9, 4, 8, 2, 7, 3, 10, 6}}; SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{5, 1, 9, 4, 8, 2, 7, 3, 10, 6}};
// ソート // sort
{ {
SPROUT_STATIC_CONSTEXPR auto sorted = sprout::stable_sort( SPROUT_STATIC_CONSTEXPR auto sorted = sprout::stable_sort(
arr1 arr1
@ -39,8 +39,8 @@ namespace testspr {
array<int, 10>{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}} array<int, 10>{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}}
)); ));
} }
// ソート // sort
// 範囲の切り出し // from sub range
{ {
SPROUT_STATIC_CONSTEXPR auto sorted = sprout::stable_sort( SPROUT_STATIC_CONSTEXPR auto sorted = sprout::stable_sort(
sprout::sub(arr1, 2, 8) sprout::sub(arr1, 2, 8)
@ -71,7 +71,7 @@ namespace testspr {
{ {
SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{5, 1, 9, 4, 8, 2, 7, 3, 10, 6}}; SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{5, 1, 9, 4, 8, 2, 7, 3, 10, 6}};
// ソート // sort
{ {
SPROUT_STATIC_CONSTEXPR auto sorted = sprout::stable_sort( SPROUT_STATIC_CONSTEXPR auto sorted = sprout::stable_sort(
arr1, arr1,
@ -92,8 +92,8 @@ namespace testspr {
array<int, 10>{{5, 10, 1, 6, 2, 7, 8, 3, 9, 4}} array<int, 10>{{5, 10, 1, 6, 2, 7, 8, 3, 9, 4}}
)); ));
} }
// ソート // sort
// 範囲の切り出し // from sub range
{ {
SPROUT_STATIC_CONSTEXPR auto sorted = sprout::stable_sort( SPROUT_STATIC_CONSTEXPR auto sorted = sprout::stable_sort(
sprout::sub(arr1, 2, 8), sprout::sub(arr1, 2, 8),

View file

@ -20,7 +20,7 @@ namespace testspr {
{ {
SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}}; SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}};
// スワップ // swap
{ {
SPROUT_STATIC_CONSTEXPR auto swapped = sprout::swap_element( SPROUT_STATIC_CONSTEXPR auto swapped = sprout::swap_element(
arr1, arr1,
@ -43,8 +43,8 @@ namespace testspr {
array<int, 10>{{1, 2, 8, 4, 5, 6, 7, 3, 9, 10}} array<int, 10>{{1, 2, 8, 4, 5, 6, 7, 3, 9, 10}}
)); ));
} }
// スワップ // swap
// 範囲の切り出し // from sub range
{ {
SPROUT_STATIC_CONSTEXPR auto swapped = sprout::swap_element( SPROUT_STATIC_CONSTEXPR auto swapped = sprout::swap_element(
sprout::sub(arr1, 2, 8), sprout::sub(arr1, 2, 8),

View file

@ -22,7 +22,7 @@ namespace testspr {
SPROUT_STATIC_CONSTEXPR auto arr2 = array<int, 10>{{}}; SPROUT_STATIC_CONSTEXPR auto arr2 = array<int, 10>{{}};
SPROUT_STATIC_CONSTEXPR auto arr3 = array<int, 4>{{}}; SPROUT_STATIC_CONSTEXPR auto arr3 = array<int, 4>{{}};
// [2 .. 8) の範囲をスワップ // swap in range [2 .. 8)
{ {
SPROUT_STATIC_CONSTEXPR auto swapped = sprout::swap_element_copy( SPROUT_STATIC_CONSTEXPR auto swapped = sprout::swap_element_copy(
sprout::begin(arr1) + 2, sprout::begin(arr1) + 2,
@ -49,8 +49,8 @@ namespace testspr {
array<int, 6>{{8, 4, 5, 6, 7, 3}} array<int, 6>{{8, 4, 5, 6, 7, 3}}
)); ));
} }
// [2 .. 8) の範囲をスワップ // swap in range [2 .. 8)
// 出力範囲をオーバーする場合 // overrun from output range
{ {
SPROUT_STATIC_CONSTEXPR auto swapped = sprout::swap_element_copy( SPROUT_STATIC_CONSTEXPR auto swapped = sprout::swap_element_copy(
sprout::begin(arr1) + 2, sprout::begin(arr1) + 2,
@ -77,8 +77,8 @@ namespace testspr {
array<int, 4>{{8, 4, 5, 6}} array<int, 4>{{8, 4, 5, 6}}
)); ));
} }
// [2 .. 8) の範囲をスワップ // swap in range [2 .. 8)
// 出力範囲の切り出し // to sub range
{ {
SPROUT_STATIC_CONSTEXPR auto swapped = sprout::swap_element_copy( SPROUT_STATIC_CONSTEXPR auto swapped = sprout::swap_element_copy(
sprout::begin(arr1) + 2, sprout::begin(arr1) + 2,

View file

@ -22,7 +22,7 @@ namespace testspr {
SPROUT_STATIC_CONSTEXPR auto arr2 = array<int, 10>{{}}; SPROUT_STATIC_CONSTEXPR auto arr2 = array<int, 10>{{}};
SPROUT_STATIC_CONSTEXPR auto arr3 = array<int, 4>{{}}; SPROUT_STATIC_CONSTEXPR auto arr3 = array<int, 4>{{}};
// [2 .. 8) の範囲を変換 // transform in range [2 .. 8) (a * 2)
{ {
SPROUT_STATIC_CONSTEXPR auto transformed = sprout::transform( SPROUT_STATIC_CONSTEXPR auto transformed = sprout::transform(
sprout::begin(arr1) + 2, sprout::begin(arr1) + 2,
@ -47,8 +47,8 @@ namespace testspr {
array<int, 6>{{6, 8, 10, 12, 14, 16}} array<int, 6>{{6, 8, 10, 12, 14, 16}}
)); ));
} }
// [2 .. 8) の範囲を変換 // transform in range [2 .. 8) (a * 2)
// 出力範囲をオーバーする場合 // overrun from output range
{ {
SPROUT_STATIC_CONSTEXPR auto transformed = sprout::transform( SPROUT_STATIC_CONSTEXPR auto transformed = sprout::transform(
sprout::begin(arr1) + 2, sprout::begin(arr1) + 2,
@ -73,8 +73,8 @@ namespace testspr {
array<int, 4>{{6, 8, 10, 12}} array<int, 4>{{6, 8, 10, 12}}
)); ));
} }
// [2 .. 8) の範囲を変換 // transform in range [2 .. 8) (a * 2)
// 出力範囲の切り出し // to sub range
{ {
SPROUT_STATIC_CONSTEXPR auto transformed = sprout::transform( SPROUT_STATIC_CONSTEXPR auto transformed = sprout::transform(
sprout::begin(arr1) + 2, sprout::begin(arr1) + 2,
@ -114,7 +114,7 @@ namespace testspr {
SPROUT_STATIC_CONSTEXPR auto arr2 = array<int, 10>{{}}; SPROUT_STATIC_CONSTEXPR auto arr2 = array<int, 10>{{}};
SPROUT_STATIC_CONSTEXPR auto arr3 = array<int, 4>{{}}; SPROUT_STATIC_CONSTEXPR auto arr3 = array<int, 4>{{}};
// [2 .. 8) の範囲を変換 // transform in range [2 .. 8) (a + b)
{ {
SPROUT_STATIC_CONSTEXPR auto transformed = sprout::transform( SPROUT_STATIC_CONSTEXPR auto transformed = sprout::transform(
sprout::begin(arr1) + 2, sprout::begin(arr1) + 2,
@ -141,8 +141,8 @@ namespace testspr {
array<int, 6>{{6, 8, 10, 12, 14, 16}} array<int, 6>{{6, 8, 10, 12, 14, 16}}
)); ));
} }
// [2 .. 8) の範囲を変換 // transform in range [2 .. 8) (a + b)
// 出力範囲をオーバーする場合 // overrun from output range
{ {
SPROUT_STATIC_CONSTEXPR auto transformed = sprout::transform( SPROUT_STATIC_CONSTEXPR auto transformed = sprout::transform(
sprout::begin(arr1) + 2, sprout::begin(arr1) + 2,
@ -169,8 +169,8 @@ namespace testspr {
array<int, 4>{{6, 8, 10, 12}} array<int, 4>{{6, 8, 10, 12}}
)); ));
} }
// [2 .. 8) の範囲を変換 // transform in range [2 .. 8) (a + b)
// 出力範囲の切り出し // to sub range
{ {
SPROUT_STATIC_CONSTEXPR auto transformed = sprout::transform( SPROUT_STATIC_CONSTEXPR auto transformed = sprout::transform(
sprout::begin(arr1) + 2, sprout::begin(arr1) + 2,

View file

@ -20,7 +20,7 @@ namespace testspr {
{ {
SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{}}; SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{}};
// 生成 // generate
{ {
SPROUT_STATIC_CONSTEXPR auto unfolded = sprout::unfold( SPROUT_STATIC_CONSTEXPR auto unfolded = sprout::unfold(
arr1, arr1,
@ -43,8 +43,8 @@ namespace testspr {
array<int, 10>{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}} array<int, 10>{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}}
)); ));
} }
// 生成 // generate
// 範囲の切り出し // from sub range
{ {
SPROUT_STATIC_CONSTEXPR auto unfolded = sprout::unfold( SPROUT_STATIC_CONSTEXPR auto unfolded = sprout::unfold(
sprout::sub(arr1, 2, 8), sprout::sub(arr1, 2, 8),

View file

@ -20,7 +20,7 @@ namespace testspr {
{ {
SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{}}; SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{}};
// 生成 // generate
{ {
SPROUT_STATIC_CONSTEXPR auto unfolded = sprout::unfold_n( SPROUT_STATIC_CONSTEXPR auto unfolded = sprout::unfold_n(
arr1, arr1,
@ -45,8 +45,8 @@ namespace testspr {
array<int, 4>{{1, 2, 3, 4}} array<int, 4>{{1, 2, 3, 4}}
)); ));
} }
// 生成 // generate
// 範囲の切り出し // from sub range
{ {
SPROUT_STATIC_CONSTEXPR auto unfolded = sprout::unfold_n( SPROUT_STATIC_CONSTEXPR auto unfolded = sprout::unfold_n(
sprout::sub(arr1, 2, 8), sprout::sub(arr1, 2, 8),

View file

@ -20,7 +20,7 @@ namespace testspr {
{ {
SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{1, 1, 3, 3, 5, 5, 7, 7, 9, 9}}; SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{1, 1, 3, 3, 5, 5, 7, 7, 9, 9}};
// 「……ユニーク」 // "...Unique".
{ {
SPROUT_STATIC_CONSTEXPR auto uniqued = sprout::unique( SPROUT_STATIC_CONSTEXPR auto uniqued = sprout::unique(
arr1 arr1
@ -39,8 +39,8 @@ namespace testspr {
array<int, 5>{{1, 3, 5, 7, 9}} array<int, 5>{{1, 3, 5, 7, 9}}
)); ));
} }
// 「……ユニーク」 // "...Unique".
// 範囲の切り出し // from sub range
{ {
SPROUT_STATIC_CONSTEXPR auto uniqued = sprout::unique( SPROUT_STATIC_CONSTEXPR auto uniqued = sprout::unique(
sprout::sub(arr1, 2, 8) sprout::sub(arr1, 2, 8)
@ -71,7 +71,7 @@ namespace testspr {
{ {
SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{1, 1, 3, 3, 5, 5, 7, 7, 9, 9}}; SPROUT_STATIC_CONSTEXPR auto arr1 = array<int, 10>{{1, 1, 3, 3, 5, 5, 7, 7, 9, 9}};
// 「……ユニーク」 // "...Unique".
{ {
SPROUT_STATIC_CONSTEXPR auto uniqued = sprout::unique( SPROUT_STATIC_CONSTEXPR auto uniqued = sprout::unique(
arr1, arr1,
@ -92,8 +92,8 @@ namespace testspr {
array<int, 5>{{1, 3, 5, 7, 9}} array<int, 5>{{1, 3, 5, 7, 9}}
)); ));
} }
// 「……ユニーク」 // "...Unique".
// 範囲の切り出し // from sub range
{ {
SPROUT_STATIC_CONSTEXPR auto uniqued = sprout::unique( SPROUT_STATIC_CONSTEXPR auto uniqued = sprout::unique(
sprout::sub(arr1, 2, 8), sprout::sub(arr1, 2, 8),

View file

@ -22,7 +22,7 @@ namespace testspr {
SPROUT_STATIC_CONSTEXPR auto arr2 = array<int, 10>{{}}; SPROUT_STATIC_CONSTEXPR auto arr2 = array<int, 10>{{}};
SPROUT_STATIC_CONSTEXPR auto arr3 = array<int, 2>{{}}; SPROUT_STATIC_CONSTEXPR auto arr3 = array<int, 2>{{}};
// [2 .. 8) の範囲「……ユニーク」 // "...Unique". in range [2 .. 8)
{ {
SPROUT_STATIC_CONSTEXPR auto uniqued = sprout::unique_copy( SPROUT_STATIC_CONSTEXPR auto uniqued = sprout::unique_copy(
sprout::begin(arr1) + 2, sprout::begin(arr1) + 2,
@ -45,8 +45,8 @@ namespace testspr {
array<int, 3>{{3, 5, 7}} array<int, 3>{{3, 5, 7}}
)); ));
} }
// [2 .. 8) の範囲「……ユニーク」 // "...Unique". in range [2 .. 8)
// 出力範囲をオーバーする場合 // overrun from output range
{ {
SPROUT_STATIC_CONSTEXPR auto uniqued = sprout::unique_copy( SPROUT_STATIC_CONSTEXPR auto uniqued = sprout::unique_copy(
sprout::begin(arr1) + 2, sprout::begin(arr1) + 2,
@ -69,8 +69,8 @@ namespace testspr {
array<int, 2>{{3, 5}} array<int, 2>{{3, 5}}
)); ));
} }
// [2 .. 8) の範囲「……ユニーク」 // "...Unique". in range [2 .. 8)
// 出力範囲の切り出し // to sub range
{ {
SPROUT_STATIC_CONSTEXPR auto uniqued = sprout::unique_copy( SPROUT_STATIC_CONSTEXPR auto uniqued = sprout::unique_copy(
sprout::begin(arr1) + 2, sprout::begin(arr1) + 2,
@ -107,7 +107,7 @@ namespace testspr {
SPROUT_STATIC_CONSTEXPR auto arr2 = array<int, 10>{{}}; SPROUT_STATIC_CONSTEXPR auto arr2 = array<int, 10>{{}};
SPROUT_STATIC_CONSTEXPR auto arr3 = array<int, 2>{{}}; SPROUT_STATIC_CONSTEXPR auto arr3 = array<int, 2>{{}};
// [2 .. 8) の範囲「……ユニーク」 // "...Unique". in range [2 .. 8)
{ {
SPROUT_STATIC_CONSTEXPR auto uniqued = sprout::unique_copy( SPROUT_STATIC_CONSTEXPR auto uniqued = sprout::unique_copy(
sprout::begin(arr1) + 2, sprout::begin(arr1) + 2,
@ -132,8 +132,8 @@ namespace testspr {
array<int, 3>{{3, 5, 7}} array<int, 3>{{3, 5, 7}}
)); ));
} }
// [2 .. 8) の範囲「……ユニーク」 // "...Unique". in range [2 .. 8)
// 出力範囲をオーバーする場合 // overrun from output range
{ {
SPROUT_STATIC_CONSTEXPR auto uniqued = sprout::unique_copy( SPROUT_STATIC_CONSTEXPR auto uniqued = sprout::unique_copy(
sprout::begin(arr1) + 2, sprout::begin(arr1) + 2,
@ -158,8 +158,8 @@ namespace testspr {
array<int, 2>{{3, 5}} array<int, 2>{{3, 5}}
)); ));
} }
// [2 .. 8) の範囲「……ユニーク」 // "...Unique". in range [2 .. 8)
// 出力範囲の切り出し // to sub range
{ {
SPROUT_STATIC_CONSTEXPR auto uniqued = sprout::unique_copy( SPROUT_STATIC_CONSTEXPR auto uniqued = sprout::unique_copy(
sprout::begin(arr1) + 2, sprout::begin(arr1) + 2,

View file

@ -26,10 +26,10 @@ namespace sprout {
merge(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp) { merge(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp) {
while (true) { while (true) {
if (first1 == last1) { if (first1 == last1) {
return std::copy(first2, last2, result); return sprout::copy(first2, last2, result);
} }
if (first2 == last2) { if (first2 == last2) {
return std::copy(first1, last1, result); return sprout::copy(first1, last1, result);
} }
*result++ = comp(*first2, *first1) *result++ = comp(*first2, *first1)
? *first2++ ? *first2++

View file

@ -47,7 +47,7 @@ namespace sprout {
typename sprout::container_traits<Container>::difference_type start, typename sprout::container_traits<Container>::difference_type start,
typename sprout::container_traits<Container>::difference_type end typename sprout::container_traits<Container>::difference_type end
) )
{ // pivot を選ぶ(中央の要素) { // select pivot (center)
return *sprout::next(origin, (end + start) / 2); return *sprout::next(origin, (end + start) / 2);
} }
template<typename Container, typename RandomAccessIterator, typename Compare> template<typename Container, typename RandomAccessIterator, typename Compare>
@ -58,7 +58,7 @@ namespace sprout {
typename sprout::container_traits<Container>::difference_type l, typename sprout::container_traits<Container>::difference_type l,
typename sprout::container_traits<Container>::value_type const& p typename sprout::container_traits<Container>::value_type const& p
) )
{ // left を見つける { // find left
return comp(*sprout::next(origin, l), p) return comp(*sprout::next(origin, l), p)
? sprout::fixed::detail::sort_find_l<Container>(origin, comp, l + 1, p) ? sprout::fixed::detail::sort_find_l<Container>(origin, comp, l + 1, p)
: l : l
@ -72,7 +72,7 @@ namespace sprout {
typename sprout::container_traits<Container>::difference_type r, typename sprout::container_traits<Container>::difference_type r,
typename sprout::container_traits<Container>::value_type const& p typename sprout::container_traits<Container>::value_type const& p
) )
{ // right を見つける { // find right
return comp(p, *sprout::next(origin, r)) return comp(p, *sprout::next(origin, r))
? sprout::fixed::detail::sort_find_r<Container>(origin, comp, r - 1, p) ? sprout::fixed::detail::sort_find_r<Container>(origin, comp, r - 1, p)
: r : r
@ -86,7 +86,7 @@ namespace sprout {
Compare comp, Compare comp,
typename sprout::container_traits<Container>::difference_type l typename sprout::container_traits<Container>::difference_type l
) )
{ // 左側をソート { // sort left side
return start < l - 1 return start < l - 1
? sprout::fixed::detail::sort_start(cont, start, l - 1, comp) ? sprout::fixed::detail::sort_start(cont, start, l - 1, comp)
: sprout::deep_copy(cont) : sprout::deep_copy(cont)
@ -100,7 +100,7 @@ namespace sprout {
Compare comp, Compare comp,
typename sprout::container_traits<Container>::difference_type r typename sprout::container_traits<Container>::difference_type r
) )
{ // 右側をソート { // sort right side
return r + 1 < end return r + 1 < end
? sprout::fixed::detail::sort_start(cont, r + 1, end, comp) ? sprout::fixed::detail::sort_start(cont, r + 1, end, comp)
: sprout::deep_copy(cont) : sprout::deep_copy(cont)
@ -116,7 +116,7 @@ namespace sprout {
typename sprout::container_traits<Container>::difference_type l, typename sprout::container_traits<Container>::difference_type l,
typename sprout::container_traits<Container>::difference_type r typename sprout::container_traits<Container>::difference_type r
) )
{ // 左右に分けてソート { // sort both side
return sprout::fixed::detail::sort_part_r( return sprout::fixed::detail::sort_part_r(
sprout::fixed::detail::sort_part_l(cont, start, comp, l), sprout::fixed::detail::sort_part_l(cont, start, comp, l),
end, end,
@ -135,7 +135,7 @@ namespace sprout {
typename sprout::container_traits<Container>::difference_type r, typename sprout::container_traits<Container>::difference_type r,
typename sprout::container_traits<Container>::value_type const& p typename sprout::container_traits<Container>::value_type const& p
) )
{ // left と right 比較して、左右に分けてソートするか、またはスワップしてこの範囲のソートを続ける { // comparing right and left, sort both side, or swap and continue
return l >= r return l >= r
? sprout::fixed::detail::sort_part_lr(cont, start, end, comp, l, r) ? sprout::fixed::detail::sort_part_lr(cont, start, end, comp, l, r)
: sprout::fixed::detail::sort_lr( : sprout::fixed::detail::sort_lr(
@ -164,7 +164,7 @@ namespace sprout {
typename sprout::container_traits<Container>::difference_type r, typename sprout::container_traits<Container>::difference_type r,
typename sprout::container_traits<Container>::value_type const& p typename sprout::container_traits<Container>::value_type const& p
) )
{ // left と right を検索 { // find left and right
return sprout::fixed::detail::sort_next( return sprout::fixed::detail::sort_next(
cont, cont,
start, start,
@ -183,7 +183,7 @@ namespace sprout {
typename sprout::container_traits<Container>::difference_type end, typename sprout::container_traits<Container>::difference_type end,
Compare comp Compare comp
) )
{ // pivot を選択してソートを開始 { // start sort
return sprout::fixed::detail::sort_lr( return sprout::fixed::detail::sort_lr(
cont, cont,
start, start,

View file

@ -21,11 +21,11 @@ namespace sprout {
template<typename T> template<typename T>
struct memchr_result { struct memchr_result {
private: private:
static void const* check(void const*); static void const* test(void const*);
static void* check(void*); static void* test(void*);
static void check(...); static void test(...);
public: public:
typedef decltype(check(std::declval<T>())) type; typedef decltype(test(std::declval<T>())) type;
}; };
template<typename PtrIterator> template<typename PtrIterator>

View file

@ -31,6 +31,7 @@
#include <sprout/type_traits/arithmetic_promote.hpp> #include <sprout/type_traits/arithmetic_promote.hpp>
#include <sprout/type_traits/float_promote.hpp> #include <sprout/type_traits/float_promote.hpp>
#include <sprout/type_traits/inherit_if_type.hpp> #include <sprout/type_traits/inherit_if_type.hpp>
#include <sprout/type_traits/enable_if.hpp>
#include <sprout/type_traits/enabler_if.hpp> #include <sprout/type_traits/enabler_if.hpp>
#include <sprout/type_traits/has_xxx.hpp> #include <sprout/type_traits/has_xxx.hpp>
#include <sprout/type_traits/inherit_if_xxx.hpp> #include <sprout/type_traits/inherit_if_xxx.hpp>

View file

@ -0,0 +1,30 @@
/*=============================================================================
Copyright (c) 2011-2014 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_ENABLE_IF_HPP
#define SPROUT_TYPE_TRAITS_ENABLE_IF_HPP
#include <sprout/config.hpp>
#include <sprout/type_traits/std_type_traits.hpp>
#include <sprout/type_traits/std_type_aliases.hpp>
namespace sprout {
//
// disable_if
//
template<bool B, typename T = void>
struct disable_if
: public sprout::enable_if<!B, T>
{};
#if SPROUT_USE_TEMPLATE_ALIASES
template<bool B, typename T = void>
using disable_if_t = typename sprout::disable_if<B, T>::type;
#endif // #if SPROUT_USE_TEMPLATE_ALIASES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_ENABLE_IF_HPP

View file

@ -35,10 +35,19 @@ namespace sprout {
: public std::enable_if<C, sprout::enabler_t&> : public std::enable_if<C, sprout::enabler_t&>
#endif #endif
{}; {};
//
// disabler_if
//
template<bool C>
struct disabler_if
: public sprout::enabler_if<!C>
{};
#if SPROUT_USE_TEMPLATE_ALIASES #if SPROUT_USE_TEMPLATE_ALIASES
template<bool C> template<bool C>
using enabler_if_t = typename sprout::enabler_if<C>::type; using enabler_if_t = typename sprout::enabler_if<C>::type;
template<bool C>
using disabler_if_t = typename sprout::disabler_if<C>::type;
#endif // #if SPROUT_USE_TEMPLATE_ALIASES #endif // #if SPROUT_USE_TEMPLATE_ALIASES
} // namespace sprout } // namespace sprout

View file

@ -58,8 +58,7 @@ namespace sprout {
&&sprout::equal(sprout::begin(arg), sprout::end(arg), ctx.begin()) &&sprout::equal(sprout::begin(arg), sprout::end(arg), ctx.begin())
? result_type( ? result_type(
true, true,
sprout::next(ctx.begin(), sprout::next(ctx.begin(), sprout::size(arg)),
sprout::size(arg)),
attribute_type(), attribute_type(),
context_type(ctx, sprout::next(ctx.begin(), sprout::size(arg))) context_type(ctx, sprout::next(ctx.begin(), sprout::size(arg)))
) )