From 8eb6e36966801c1f75653e565f3ba291963dd0de Mon Sep 17 00:00:00 2001 From: Matthew Parkinson Date: Fri, 26 Apr 2019 11:45:10 +0100 Subject: [PATCH] Add comment about min/max. --- src/ds/bits.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/ds/bits.h b/src/ds/bits.h index 7e2f8bc..09dbf17 100644 --- a/src/ds/bits.h +++ b/src/ds/bits.h @@ -453,12 +453,24 @@ namespace snmalloc } } + /** + * Implementation of std::min + * + * std::min is algorithm, so pulls in a lot of unneccessary code + * We write our own to reduce the code that potentially needs reviewing. + **/ template constexpr inline T min(T t1, T t2) { return t1 < t2 ? t1 : t2; } + /** + * Implementation of std::max + * + * std::max is algorithm, so pulls in a lot of unneccessary code + * We write our own to reduce the code that potentially needs reviewing. + **/ template constexpr inline T max(T t1, T t2) {