1
0
Fork 0
mirror of https://github.com/bolero-MURAKAMI/Sprout synced 2025-08-03 12:49:50 +00:00

rewrite sprout::algorithm::join performance

This commit is contained in:
bolero-MURAKAMI 2012-05-22 01:06:13 +09:00
parent 0ceabb5b9b
commit 1ea9d30e2a
145 changed files with 1359 additions and 364 deletions

View file

@ -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
//
@ -23,13 +23,13 @@
int
main(){
namespace w = sprout::weed;
//
// __TIME__ to Sprout.String
//
static constexpr auto time = sprout::to_string(__TIME__);
// static constexpr auto time = sprout::to_string("23:22:45");
//
// parse __TIME__
@ -37,8 +37,8 @@ main(){
constexpr auto expr = w::int_ >> ':' >> w::int_ >> ':' >> w::int_;
static constexpr auto result = w::parse(time.begin(), time.end(), parser);
static_assert(result.success(), "failed parse");
//
// get result
//
@ -54,8 +54,8 @@ main(){
std::cout << hour << std::endl;
std::cout << minute << std::endl;
std::cout << second << std::endl;
//
// compile time output
//

View file

@ -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
//
@ -18,11 +18,11 @@
int
main(){
namespace w = sprout::weed;
static constexpr auto max_string_size = 32;
static constexpr auto space = *w::omit[ w::space ];
static constexpr auto remove_space = *w::lim<max_string_size>(space >> w::char_);
static constexpr auto source = sprout::to_string(" homu : mami= 10 ");
static constexpr auto result = w::parse(
sprout::begin(source), sprout::end(source),