Last active
March 26, 2017 18:56
-
-
Save stryku/34ee78d893ab8c605c09ea5e8b79b319 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace details | |
{ | |
template <typename s, typename current_tokens = tuple<>> | |
struct tokenize_impl; | |
template <typename current_tokens> | |
struct tokenize_impl<string<>, current_tokens> | |
{ | |
using tokens = current_tokens; | |
}; | |
template <char ...str_chars, typename current_tokens> | |
struct tokenize_impl<string<str_chars...>, current_tokens> | |
{ | |
using str = string<str_chars...>; | |
using get_token_t = get_token<str>; | |
using next_tokens = tuple_append<current_tokens, typename get_token_t::result_token>; | |
using next_string = typename get_token_t::rest_of_string; | |
using tokens = typename tokenize_impl<next_string, next_tokens>::tokens; | |
}; | |
} | |
template <typename s> | |
using tokenize = typename details::tokenize_impl<s>::tokens; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment