diff options
author | Behdad Esfahbod <behdad@behdad.org> | 2018-08-28 17:04:52 -0700 |
---|---|---|
committer | Behdad Esfahbod <behdad@behdad.org> | 2018-08-28 17:04:52 -0700 |
commit | 40531065c3041c5e65e0197b8e140585a8ff051d (patch) | |
tree | 77d096503e479d038b68097f54b782ac7eb0d8fd | |
parent | 2dde6c803a9e50c5bff74095187b0cb2e12eebdd (diff) | |
download | harfbuzz-rvalue-reference.tar.gz |
C++11 solution for previous commitrvalue-reference
Let's see which gods (new term we use to refer to build bots) we anger.
Will revert after.
-rw-r--r-- | src/hb-dsalgs.hh | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/src/hb-dsalgs.hh b/src/hb-dsalgs.hh index 8c910748..5be6b270 100644 --- a/src/hb-dsalgs.hh +++ b/src/hb-dsalgs.hh @@ -492,14 +492,7 @@ template <typename Type> struct hb_auto_t : Type { hb_auto_t (void) { Type::init (); } - /* Explicitly allow the following only for pointer and references, - * to avoid any accidental copies. - * - * Apparently if we template for all types, then gcc seems to - * capture a reference argument in the type, but clang doesn't, - * causing unwanted copies and bugs that come with it. */ - template <typename T1> hb_auto_t (T1 *t1) { Type::init (t1); } - template <typename T1> hb_auto_t (T1 &t1) { Type::init (t1); } + template <typename T1> hb_auto_t (T1 &&t1) { Type::init (t1); } ~hb_auto_t (void) { Type::fini (); } private: /* Hide */ void init (void) {} |