[algs] Fix hb_inc/dec signature

This commit is contained in:
Behdad Esfahbod committed 2019-08-31 12:24:56 -05:00
1 parent b1378d8a21
commit 3bc86fb237
2 files changed
+7 -2

No files matched your search

+3 -2
View File
@@ -82,6 +82,7 @@ HB_FUNCOBJ (hb_bool);
struct
{
private:
template <typename T> constexpr auto
impl (const T& v, hb_priority<1>) const HB_RETURN (uint32_t, hb_deref (v).hash ())
@@ -997,13 +998,13 @@ HB_FUNCOBJ (hb_neg);
struct
{
template <typename T> constexpr auto
operator () (const T &a) const HB_AUTO_RETURN (++a)
operator () (T &a) const HB_AUTO_RETURN (++a)
}
HB_FUNCOBJ (hb_inc);
struct
{
template <typename T> constexpr auto
operator () (const T &a) const HB_AUTO_RETURN (--a)
operator () (T &a) const HB_AUTO_RETURN (--a)
}
HB_FUNCOBJ (hb_dec);
+4
View File
@@ -87,5 +87,9 @@ main (int argc, char **argv)
assert (hb_add (2) (5) == 7);
assert (hb_add (5) (2) == 7);
x = 1;
assert (++hb_inc (x) == 3);
assert (x == 3);
return 0;
}