From 2d5643aed4a5a4bc3ea129d4af3dcbe7af7b9995 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 30 Aug 2019 09:51:22 -0500 Subject: [PATCH] [algs] Add hb_inc() and hb_dec()) --- src/hb-algs.hh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/hb-algs.hh b/src/hb-algs.hh index 788689478..78b86f37a 100644 --- a/src/hb-algs.hh +++ b/src/hb-algs.hh @@ -994,6 +994,18 @@ struct operator () (const T &a) const HB_AUTO_RETURN (-a) } HB_FUNCOBJ (hb_neg); +struct +{ + template constexpr auto + operator () (const T &a) const HB_AUTO_RETURN (++a) +} +HB_FUNCOBJ (hb_inc); +struct +{ + template constexpr auto + operator () (const T &a) const HB_AUTO_RETURN (--a) +} +HB_FUNCOBJ (hb_dec); /* Compiler-assisted vectorization. */