2013-08-08 09:54:33 +00:00
|
|
|
/*=============================================================================
|
2014-01-08 07:48:12 +00:00
|
|
|
Copyright (c) 2011-2014 Bolero MURAKAMI
|
2013-08-08 09:54:33 +00:00
|
|
|
https://github.com/bolero-MURAKAMI/Sprout
|
|
|
|
|
|
|
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
|
|
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|
|
|
=============================================================================*/
|
2012-04-14 10:06:21 +00:00
|
|
|
#ifndef SPROUT_STRING_MAKE_STRING_HPP
|
|
|
|
#define SPROUT_STRING_MAKE_STRING_HPP
|
|
|
|
|
|
|
|
#include <cstddef>
|
|
|
|
#include <type_traits>
|
|
|
|
#include <sprout/config.hpp>
|
|
|
|
#include <sprout/string/char_traits.hpp>
|
|
|
|
#include <sprout/string/string.hpp>
|
|
|
|
#include <sprout/utility/forward.hpp>
|
|
|
|
|
|
|
|
namespace sprout {
|
|
|
|
//
|
|
|
|
// make_string
|
|
|
|
//
|
|
|
|
template<typename T, typename... Types>
|
|
|
|
inline SPROUT_CONSTEXPR sprout::basic_string<typename std::decay<T>::type, 1 + sizeof...(Types)>
|
|
|
|
make_string(T&& t, Types&&... args) {
|
2012-04-17 15:58:34 +00:00
|
|
|
typedef sprout::detail::make_construct_impl<
|
|
|
|
sprout::basic_string<typename std::decay<T>::type, 1 + sizeof...(Types)>
|
|
|
|
> impl_type;
|
2014-02-22 07:32:51 +00:00
|
|
|
return impl_type::make(SPROUT_FORWARD(T, t), SPROUT_FORWARD(Types, args)...);
|
2012-04-14 10:06:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// make_string_as
|
|
|
|
//
|
|
|
|
template<typename T>
|
|
|
|
inline SPROUT_CONSTEXPR sprout::basic_string<typename std::decay<T>::type, 0>
|
|
|
|
make_string_as() {
|
2013-08-09 10:04:37 +00:00
|
|
|
return sprout::basic_string<typename std::decay<T>::type, 0>();
|
2012-04-14 10:06:21 +00:00
|
|
|
}
|
|
|
|
template<typename T, typename... Types>
|
|
|
|
inline SPROUT_CONSTEXPR sprout::basic_string<typename std::decay<T>::type, sizeof...(Types)>
|
|
|
|
make_string_as(Types&&... args) {
|
2012-04-17 15:58:34 +00:00
|
|
|
typedef sprout::detail::make_construct_impl<
|
|
|
|
sprout::basic_string<typename std::decay<T>::type, sizeof...(Types)>
|
|
|
|
> impl_type;
|
2014-02-22 07:32:51 +00:00
|
|
|
return impl_type::make(SPROUT_FORWARD(Types, args)...);
|
2012-04-14 10:06:21 +00:00
|
|
|
}
|
|
|
|
} // namespace sprout
|
|
|
|
|
|
|
|
#endif // #ifndef SPROUT_STRING_MAKE_STRING_HPP
|