summaryrefslogtreecommitdiffstats
path: root/src/2geom
diff options
context:
space:
mode:
Diffstat (limited to 'src/2geom')
-rw-r--r--src/2geom/piecewise.h20
1 files 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 <typename F>
- 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<F>(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 <typename F>
- inline void push_seg(F &&s) {
- segs.emplace_back(std::forward<F>(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.