[algs] Fix hb_inc/dec signature
This commit is contained in:
parent
b1378d8a21
commit
3bc86fb237
|
@ -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);
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue