#ifndef SPROUT_STRING_MAKE_STRING_HPP #define SPROUT_STRING_MAKE_STRING_HPP #include #include #include #include #include #include #include #include namespace sprout { // // make_string // namespace detail { template inline SPROUT_CONSTEXPR sprout::basic_string make_string_impl_1( sprout::array const& arr, std::size_t n, sprout::index_tuple ) { return sprout::basic_string{{(Indexes < n ? arr[Indexes] : T())...}, n}; } template inline SPROUT_CONSTEXPR sprout::basic_string make_string_impl( sprout::array const& arr, sprout::index_tuple ) { return sprout::detail::make_string_impl_1( arr, sprout::char_traits::length(arr.begin()), sprout::index_tuple() ); } } // namespace detail template inline SPROUT_CONSTEXPR sprout::basic_string::type, 1 + sizeof...(Types)> make_string(T&& t, Types&&... args) { return sprout::detail::make_string_impl( sprout::make_array::type>( sprout::forward(t), sprout::forward(args)..., typename std::decay::type() ), typename sprout::index_range<0, 1 + sizeof...(Types)>::type() ); } // // make_string_as // template inline SPROUT_CONSTEXPR sprout::basic_string::type, 0> make_string_as() { return sprout::basic_string::type, 0>{}; } template inline SPROUT_CONSTEXPR sprout::basic_string::type, sizeof...(Types)> make_string_as(Types&&... args) { return sprout::detail::make_string_impl( sprout::make_array::type>( sprout::forward(args)..., typename std::decay::type() ), typename sprout::index_range<0, 1 + sizeof...(Types)>::type() ); } } // namespace sprout #endif // #ifndef SPROUT_STRING_MAKE_STRING_HPP