Sprout/sprout/weed/detail/c_str_as_string.hpp

50 lines
1.5 KiB
C++
Raw Normal View History

2011-11-13 08:54:38 +00:00
#ifndef SPROUT_WEED_DETAIL_C_STR_AS_STRING_HPP
#define SPROUT_WEED_DETAIL_C_STR_AS_STRING_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/string.hpp>
2013-03-25 03:43:47 +00:00
#include <sprout/type_traits/identity.hpp>
#include <sprout/type/void.hpp>
2011-11-13 08:54:38 +00:00
namespace sprout {
namespace weed {
namespace detail {
template<typename T>
struct c_str_as_string
: public sprout::identity<sprout::types::void_>
{};
2013-03-25 03:43:47 +00:00
template<typename T>
struct c_str_as_string<T const>
: public sprout::weed::detail::c_str_as_string<T>
{};
template<typename T>
struct c_str_as_string<T volatile>
: public sprout::weed::detail::c_str_as_string<T>
{};
template<typename T>
struct c_str_as_string<T const volatile>
: public sprout::weed::detail::c_str_as_string<T>
{};
template<typename T, std::size_t N>
struct c_str_as_string<T[N]>
: public sprout::identity<sprout::basic_string<T, N - 1> >
{};
template<typename T, std::size_t N>
struct c_str_as_string<T const[N]>
: public sprout::identity<sprout::basic_string<T, N - 1> >
{};
template<typename T, std::size_t N>
struct c_str_as_string<T volatile[N]>
: public sprout::identity<sprout::basic_string<T, N - 1> >
{};
2011-11-13 08:54:38 +00:00
template<typename T, std::size_t N>
2013-03-25 03:43:47 +00:00
struct c_str_as_string<T const volatile[N]>
: public sprout::identity<sprout::basic_string<T, N - 1> >
{};
2011-11-13 08:54:38 +00:00
} // namespace detail
} // namespace weed
} // namespace sprout
#endif // #ifndef SPROUT_WEED_DETAIL_C_STR_AS_STRING_HPP