[algs] Sprinkle hb_min/max with hb-forward salad

Let's see if fixes MSVC fail.  Though, the error doesn't make sense to me.

  hb-blob.cc
c:\projects\harfbuzz\src\hb-algs.hh(166): error C2440: 'return': cannot convert from 'unsigned int' to 'unsigned int &&' [C:\projects\harfbuzz\build\harfbuzz.vcxproj]
  c:\projects\harfbuzz\src\hb-algs.hh(166): note: You cannot bind an lvalue to an rvalue reference
  c:\projects\harfbuzz\src\hb-algs.hh(174): note: see reference to function template instantiation 'T &&<unnamed-type-hb_min>::impl<T,unsigned int&>(T &&,T2) const' being compiled
          with
          [
              T=unsigned int,
              T2=unsigned int &
          ]
This commit is contained in:
Behdad Esfahbod 2019-05-07 23:08:49 -07:00
parent bdbfdc92b5
commit 56d2d0294b
1 changed files with 6 additions and 4 deletions

View File

@ -163,11 +163,12 @@ struct
{
private:
template <typename T, typename T2> auto
impl (T&& a, T2&& b) const HB_AUTO_RETURN (a <= b ? a : b)
impl (T&& a, T2&& b) const HB_AUTO_RETURN
(hb_forward<T> (a) <= hb_forward<T2> (b) ? hb_forward<T> (a) : hb_forward<T2> (b))
public:
template <typename T> auto
operator () (T&& a) const HB_AUTO_RETURN (a)
operator () (T&& a) const HB_AUTO_RETURN (hb_forward<T> (a))
template <typename T, typename... Ts> auto
operator () (T&& a, Ts&& ...ds) const HB_AUTO_RETURN
@ -178,11 +179,12 @@ struct
{
private:
template <typename T, typename T2> auto
impl (T&& a, T2&& b) const HB_AUTO_RETURN (a >= b ? a : b)
impl (T&& a, T2&& b) const HB_AUTO_RETURN
(hb_forward<T> (a) >= hb_forward<T2> (b) ? hb_forward<T> (a) : hb_forward<T2> (b))
public:
template <typename T> auto
operator () (T&& a) const HB_AUTO_RETURN (a)
operator () (T&& a) const HB_AUTO_RETURN (hb_forward<T> (a))
template <typename T, typename... Ts> auto
operator () (T&& a, Ts&& ...ds) const HB_AUTO_RETURN