diff options
author | Ben Longbons <b.r.longbons@gmail.com> | 2014-03-15 19:34:59 -0700 |
---|---|---|
committer | Ben Longbons <b.r.longbons@gmail.com> | 2014-03-16 18:58:48 -0700 |
commit | c812c92d1a1835f0bda783e709481188c8d92225 (patch) | |
tree | b401ede48a088ad1aaed88fe3b997cd26ff7ae08 /src/compat/alg.hpp | |
parent | de9ee1b9754af9d954487121947352f32d7ebb7e (diff) | |
download | tmwa-c812c92d1a1835f0bda783e709481188c8d92225.tar.gz tmwa-c812c92d1a1835f0bda783e709481188c8d92225.tar.bz2 tmwa-c812c92d1a1835f0bda783e709481188c8d92225.tar.xz tmwa-c812c92d1a1835f0bda783e709481188c8d92225.zip |
Clean up header organization
Diffstat (limited to 'src/compat/alg.hpp')
-rw-r--r-- | src/compat/alg.hpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/compat/alg.hpp b/src/compat/alg.hpp new file mode 100644 index 0000000..250c161 --- /dev/null +++ b/src/compat/alg.hpp @@ -0,0 +1,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 |