2013-08-08 09:54:33 +00:00
|
|
|
/*=============================================================================
|
2016-02-25 09:48:28 +00:00
|
|
|
Copyright (c) 2011-2016 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-10-05 15:58:56 +00:00
|
|
|
#ifndef SPROUT_CONTAINER_DETAIL_ARRAY_LIKE_HPP
|
|
|
|
#define SPROUT_CONTAINER_DETAIL_ARRAY_LIKE_HPP
|
|
|
|
|
|
|
|
#include <sprout/config.hpp>
|
2014-04-30 07:30:26 +00:00
|
|
|
#include <sprout/workaround/std/cstddef.hpp>
|
2013-11-22 12:11:08 +00:00
|
|
|
#include <sprout/type_traits/integral_constant.hpp>
|
2012-10-05 15:58:56 +00:00
|
|
|
|
|
|
|
namespace sprout {
|
|
|
|
namespace detail {
|
|
|
|
template<typename Container>
|
|
|
|
struct is_array_like
|
2013-11-22 12:11:08 +00:00
|
|
|
: public sprout::false_type
|
2012-10-05 15:58:56 +00:00
|
|
|
{};
|
|
|
|
template<template<typename, std::size_t> class Array, typename T, std::size_t N>
|
|
|
|
struct is_array_like<Array<T, N> >
|
2013-11-22 12:11:08 +00:00
|
|
|
: public sprout::true_type
|
2012-10-05 15:58:56 +00:00
|
|
|
{};
|
|
|
|
template<typename Container>
|
|
|
|
struct is_array_like<Container const>
|
|
|
|
: public sprout::detail::is_array_like<Container>
|
|
|
|
{};
|
|
|
|
template<typename Container>
|
|
|
|
struct is_array_like<Container volatile>
|
|
|
|
: public sprout::detail::is_array_like<Container>
|
|
|
|
{};
|
|
|
|
template<typename Container>
|
|
|
|
struct is_array_like<Container const volatile>
|
|
|
|
: public sprout::detail::is_array_like<Container>
|
|
|
|
{};
|
|
|
|
|
|
|
|
template<typename Container>
|
|
|
|
struct array_like_static_size {};
|
|
|
|
template<template<typename, std::size_t> class Array, typename T, std::size_t N>
|
|
|
|
struct array_like_static_size<Array<T, N> >
|
2013-11-22 12:11:08 +00:00
|
|
|
: public sprout::integral_constant<std::size_t, N>
|
2012-10-05 15:58:56 +00:00
|
|
|
{};
|
|
|
|
template<typename Container>
|
|
|
|
struct array_like_static_size<Container const>
|
|
|
|
: public sprout::detail::array_like_static_size<Container>
|
|
|
|
{};
|
|
|
|
template<typename Container>
|
|
|
|
struct array_like_static_size<Container volatile>
|
|
|
|
: public sprout::detail::array_like_static_size<Container>
|
|
|
|
{};
|
|
|
|
template<typename Container>
|
|
|
|
struct array_like_static_size<Container const volatile>
|
|
|
|
: public sprout::detail::array_like_static_size<Container>
|
|
|
|
{};
|
|
|
|
} // namespace detail
|
|
|
|
} // namespace sprout
|
|
|
|
|
|
|
|
#endif // #ifndef SPROUT_CONTAINER_DETAIL_ARRAY_LIKE_HPP
|