mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2025-07-02 14:04:20 +00:00
rewrite sprout::algorithm::join performance
This commit is contained in:
parent
0ceabb5b9b
commit
1ea9d30e2a
145 changed files with 1359 additions and 364 deletions
|
@ -4,7 +4,7 @@
|
|||
// Copyright (c) 2012
|
||||
// bolero-MURAKAMI : http://d.hatena.ne.jp/boleros/
|
||||
// osyo-manga : http://d.hatena.ne.jp/osyo-manga/
|
||||
//
|
||||
//
|
||||
// Readme:
|
||||
// https://github.com/osyo-manga/cpp-half/blob/master/README
|
||||
//
|
||||
|
@ -26,9 +26,9 @@ struct fizzbuzz{
|
|||
constexpr result_type
|
||||
operator ()(int n) const{
|
||||
return n % 15 == 0 ? sprout::to_string("FizzBuzz")
|
||||
: n % 3 == 0 ? sprout::to_string("Fizz")
|
||||
: n % 5 == 0 ? sprout::to_string("Buzz")
|
||||
: sprout::to_string(n);
|
||||
: n % 3 == 0 ? sprout::to_string("Fizz")
|
||||
: n % 5 == 0 ? sprout::to_string("Buzz")
|
||||
: sprout::to_string(n);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -45,7 +45,7 @@ main(){
|
|||
static_assert(fizzbuzz()( 3) == "Fizz", "");
|
||||
static_assert(fizzbuzz()( 5) == "Buzz", "");
|
||||
static_assert(fizzbuzz()(15) == "FizzBuzz", "");
|
||||
|
||||
|
||||
//
|
||||
// Sequence [1..15]
|
||||
//
|
||||
|
@ -63,7 +63,7 @@ main(){
|
|||
sprout::pit<sprout::array<string, 15> >(),
|
||||
fizzbuzz()
|
||||
);
|
||||
|
||||
|
||||
//
|
||||
// Check result
|
||||
//
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue