From 77ee5126e1c6018364eb2e2d398c7b9c73f6cceb Mon Sep 17 00:00:00 2001 From: Romain Goyet Date: Sun, 12 Apr 2020 15:38:03 -0400 Subject: [PATCH] [libaxx] Add algorithm Only contains a super simple min and max implementation --- libaxx/include/algorithm | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 libaxx/include/algorithm diff --git a/libaxx/include/algorithm b/libaxx/include/algorithm new file mode 100644 index 000000000..b2c7073c4 --- /dev/null +++ b/libaxx/include/algorithm @@ -0,0 +1,18 @@ +#ifndef LIBAXX_ALGORITHM +#define LIBAXX_ALGORITHM + +namespace std { + +template +inline const T & min(const T & a, const T & b ) { + return (b < a) ? b : a; +} + +template +inline const T & max(const T & a, const T & b ) { + return (b > a) ? b : a; +} + +} + +#endif