forked from taocpp/sequences
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmin.hpp
35 lines (28 loc) · 734 Bytes
/
min.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Copyright (c) 2015-2017 Daniel Frey
// Please see LICENSE for license or visit https://github.com/taocpp/sequences/
#ifndef TAOCPP_SEQUENCES_INCLUDE_MIN_HPP
#define TAOCPP_SEQUENCES_INCLUDE_MIN_HPP
#include "fold.hpp"
#include <type_traits>
namespace tao
{
namespace seq
{
namespace impl
{
template< typename T, T A, T B >
using min = std::integral_constant< T, ( ( A < B ) ? A : B ) >;
}
template< typename T, T... Ns >
struct min
: fold< impl::min, T, Ns... >
{
};
template< typename T, T... Ns >
struct min< integer_sequence< T, Ns... > >
: min< T, Ns... >
{
};
}
}
#endif // TAOCPP_SEQUENCES_INCLUDE_MIN_HPP