summaryrefslogtreecommitdiff
path: root/src/compat/alg.hpp
blob: 250c161bcfe83c1c43d21be759fd4bd46c1aa617 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#ifndef TMWA_COMPAT_ALG_HPP
#define TMWA_COMPAT_ALG_HPP

# include "../sanity.hpp"

# include <type_traits>


template<class A, class B>
typename std::common_type<A, B>::type min(A a, B b)
{
    return a < b ? a : b;
}

template<class A, class B>
typename std::common_type<A, B>::type max(A a, B b)
{
    return b < a ? a : b;
}

#endif // TMWA_COMPAT_ALG_HPP