1
0
Fork 0
mirror of https://github.com/bolero-MURAKAMI/Sprout synced 2025-08-03 12:49:50 +00:00

fix weed type_traits

This commit is contained in:
bolero-MURAKAMI 2013-03-25 12:43:47 +09:00
parent f712788cce
commit c78e1d0e6d
27 changed files with 279 additions and 306 deletions

View file

@ -4,17 +4,41 @@
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/string.hpp>
#include <sprout/type_traits/identity.hpp>
namespace sprout {
namespace weed {
namespace detail {
template<typename T>
struct c_str_as_string;
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 const[N]> {
public:
typedef sprout::basic_string<T, N - 1> type;
};
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> >
{};
template<typename T, std::size_t N>
struct c_str_as_string<T const volatile[N]>
: public sprout::identity<sprout::basic_string<T, N - 1> >
{};
} // namespace detail
} // namespace weed
} // namespace sprout