1
0
Fork 0
mirror of https://github.com/bolero-MURAKAMI/Sprout synced 2024-11-12 21:09:01 +00:00
Sprout/sprout/detail/if.hpp
bolero-MURAKAMI b3bb8121e8 最初
2011-09-01 02:48:32 +00:00

30 lines
587 B
C++

#ifndef SPROUT_DETAIL_IF_HPP
#define SPROUT_DETAIL_IF_HPP
#include <sprout/config.hpp>
namespace sprout {
namespace detail {
//
// if_c
//
template<bool C, typename T1, typename T2>
struct if_c {
typedef T1 type;
};
template<typename T1, typename T2>
struct if_c<false, T1, T2> {
typedef T2 type;
};
//
// if_
//
template<typename Cond, typename T1, typename T2>
struct if_
: public sprout::detail::if_c<Cond::value, T1, T2>
{};
} // namespace detail
} // namespace sprout
#endif // #ifndef SPROUT_DETAIL_IF_HPP