mirror of
https://github.com/bolero-MURAKAMI/Sprout
synced 2025-08-03 12:49:50 +00:00
is_sub_array 更新
is_array, is_basic_string 追加
This commit is contained in:
parent
fd1cfd05af
commit
79dd17c747
3 changed files with 179 additions and 20 deletions
|
@ -544,29 +544,35 @@ namespace sprout {
|
|||
}
|
||||
};
|
||||
|
||||
namespace detail {
|
||||
template<typename T, typename Enable = void>
|
||||
struct is_sub_array_impl {
|
||||
public:
|
||||
typedef std::integral_constant<bool, false> type;
|
||||
SPROUT_STATIC_CONSTEXPR bool value = type::value;
|
||||
};
|
||||
template<typename T>
|
||||
struct is_sub_array_impl<
|
||||
T,
|
||||
typename std::enable_if<
|
||||
std::is_same<
|
||||
T,
|
||||
sprout::sub_array<typename T::container_type>
|
||||
>::value
|
||||
>::type
|
||||
> {
|
||||
public:
|
||||
typedef std::integral_constant<bool, true> type;
|
||||
SPROUT_STATIC_CONSTEXPR bool value = type::value;
|
||||
};
|
||||
} // namespace detail
|
||||
//
|
||||
// is_sub_array
|
||||
//
|
||||
template<typename T, typename Enable = void>
|
||||
struct is_sub_array {
|
||||
public:
|
||||
typedef std::integral_constant<bool, false> type;
|
||||
SPROUT_STATIC_CONSTEXPR bool value = type::value;
|
||||
};
|
||||
template<typename T>
|
||||
struct is_sub_array<
|
||||
T,
|
||||
typename std::enable_if<
|
||||
std::is_same<
|
||||
T,
|
||||
sprout::sub_array<typename T::container_type>
|
||||
>::value
|
||||
>::type
|
||||
> {
|
||||
public:
|
||||
typedef std::integral_constant<bool, true> type;
|
||||
SPROUT_STATIC_CONSTEXPR bool value = type::value;
|
||||
};
|
||||
struct is_sub_array
|
||||
: public sprout::detail::is_sub_array_impl<T>
|
||||
{};
|
||||
|
||||
//
|
||||
// sub
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue