From 3d20ef63bebcf367ef4907081f5624069d2f7963 Mon Sep 17 00:00:00 2001 From: Thomas Holder Date: Sun, 30 Sep 2018 21:43:08 +0200 Subject: Revert "c++11 refactor: ifdef CPP11 -> std::forward" This reverts commit f9500954af2d6130069087970f8ed97ab61d13c2. --- src/2geom/piecewise.h | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/2geom/piecewise.h b/src/2geom/piecewise.h index 174ac2733..3a12671e0 100644 --- a/src/2geom/piecewise.h +++ b/src/2geom/piecewise.h @@ -138,22 +138,28 @@ class Piecewise { /**Convenience/implementation hiding function to add segment/cut pairs. * Asserts that basic size and order invariants are correct */ - template - inline void push(F &&s, double to) { + inline void push(const T &s, double to) { assert(cuts.size() - segs.size() == 1); - push_seg(std::forward(s)); + push_seg(s); + push_cut(to); + } +#ifdef CPP11 + inline void push(T &&s, double to) { + assert(cuts.size() - segs.size() == 1); + push_seg(s); push_cut(to); } +#endif //Convenience/implementation hiding function to add cuts. inline void push_cut(double c) { ASSERT_INVARIANTS(cuts.empty() || c > cuts.back()); cuts.push_back(c); } //Convenience/implementation hiding function to add segments. - template - inline void push_seg(F &&s) { - segs.emplace_back(std::forward(s)); - } + inline void push_seg(const T &s) { segs.push_back(s); } +#ifdef CPP11 + inline void push_seg(T &&s) { segs.emplace_back(s); } +#endif /**Returns the segment index which corresponds to a 'global' piecewise time. * Also takes optional low/high parameters to expedite the search for the segment. -- cgit v1.2.3