Sprout/sprout/breed/detail/template_arity.hpp
2012-02-08 23:39:36 +09:00

25 lines
698 B
C++

#ifndef SPROUT_BREED_DETAIL_TEMPLATE_ARITY_HPP
#define SPROUT_BREED_DETAIL_TEMPLATE_ARITY_HPP
#include <type_traits>
#include <sprout/config.hpp>
namespace sprout {
namespace breed {
namespace detail {
template<typename F>
struct template_arity_impl;
template<template<typename...> class F, typename... Args>
struct template_arity_impl<F<Args...> >
: public std::integral_constant<int, sizeof...(Args)>
{};
template<typename F>
struct template_arity
: public sprout::breed::detail::template_arity_impl<F>
{};
} // namespace detail
} // namespace breed
} // namespace sprout
#endif // #ifndef SPROUT_BREED_DETAIL_TEMPLATE_ARITY_HPP