Program Listing for File space_traits.hpp¶
↰ Return to documentation for file (include/ripple/space/space_traits.hpp
)
#ifndef RIPPLE_SPACE_SPACE_TRAITS_HPP
#define RIPPLE_SPACE_SPACE_TRAITS_HPP
#include <ripple/utility/portability.hpp>
namespace ripple {
/*==--- [forward declations] -----------------------------------------------==*/
template <typename Impl>
struct MultidimSpace;
template <size_t Dimensions>
struct DynamicMultidimSpace;
template <size_t... Sizes>
struct StaticMultidimSpace;
/*==--- [traits declations] ------------------------------------------------==*/
template <typename Space>
struct SpaceTraits {
static constexpr size_t dimensions = 1;
};
template <size_t... Sizes>
struct SpaceTraits<StaticMultidimSpace<Sizes...>> {
static constexpr size_t dimensions = sizeof...(Sizes);
};
template <size_t Dimensions>
struct SpaceTraits<DynamicMultidimSpace<Dimensions>> {
static constexpr size_t dimensions = Dimensions;
};
template <typename SpaceImpl>
struct SpaceTraits<MultidimSpace<SpaceImpl>> {
static constexpr size_t dimensions = SpaceTraits<SpaceImpl>::dimensions;
};
/*==--- [aliases] ----------------------------------------------------------==*/
template <typename T>
using space_traits_t = SpaceTraits<std::decay_t<T>>;
} // namespace ripple
#endif // RIPPLE_SPACE_SPACE_TRAITS_HPP