From fd3857da3d3f6a8ec80184d48a6ca0bd48d23091 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Mon, 7 Feb 2011 13:16:41 -0200 Subject: [PATCH] Implement minmax() --- flower/include/direction.hh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/flower/include/direction.hh b/flower/include/direction.hh index 0ba482fe2c..befd0aa2ac 100644 --- a/flower/include/direction.hh +++ b/flower/include/direction.hh @@ -75,7 +75,13 @@ flip (Direction *i) if d > 0: the max operator if d < 0: the min operator */ -template T minmax (Direction d, T, T); +template T minmax (Direction d, T a, T b) +{ + if (d == UP) + return max (a, b); + else + return min (a, b); +} // String direction_string (Direction, Axis); -- 2.39.2