#pragma once #include #include namespace mbgl { // Using structs instead of constexpr templates because GCC 4.9 doesn't support these yet. template struct string_literal { static constexpr const char chars[] = { Cs..., 0 }; static constexpr const char* value() { return chars; } }; template constexpr const char string_literal::chars[]; namespace detail { using string_fn = const char* (*)(); template string_literal to_string_literal(std::index_sequence); constexpr std::size_t string_length(const char* const str, std::size_t len = 0) { return str[0] ? string_length(str + 1, len + 1) : len; } template struct concat_literals; template <> struct concat_literals<> { static constexpr auto value() { return ""; } }; template struct concat_literals, string_literal, Rest...> { static constexpr auto value() { return concat_literals, Rest...>::value(); } }; template struct concat_literals> { static constexpr auto value() { return string_literal::value(); } }; } // namespace detail template struct concat_literals { static constexpr auto value() { return detail::concat_literals( std::make_index_sequence()))...>::value(); } }; } // namespace mbgl