Skip to content

Instantly share code, notes, and snippets.

@stryku
Created March 5, 2017 19:19
Show Gist options
  • Save stryku/6e9c22433cb1fc8e30accdc29be9b0e5 to your computer and use it in GitHub Desktop.
Save stryku/6e9c22433cb1fc8e30accdc29be9b0e5 to your computer and use it in GitHub Desktop.
template <char ...label_chars, typename ...rest_of_tokens, typename labels, typename ...current_tokens>
struct substitute_labels_impl<
tuple<string<'.', label_chars...>, rest_of_tokens...>,
labels,
tuple<current_tokens...>>
{
static constexpr auto ip = labels_get_ip<labels, string<'.', label_chars...>>;
using str_ip = string_from_int<ip>;
using substitued = substitute_labels_impl<
tuple<rest_of_tokens...>,
labels,
tuple<current_tokens..., str_ip>>;
using tokens = typename substitued::tokens;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment