summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThomas Holder <thomas@thomas-holder.de>2018-09-30 19:43:08 +0000
committerThomas Holder <thomas@thomas-holder.de>2018-09-30 19:43:08 +0000
commit3d20ef63bebcf367ef4907081f5624069d2f7963 (patch)
tree6ffb04f89df9659fa8d57fa40d533404596934d2 /src
parentuse poppler-transition-api instead of ifdefs (diff)
downloadinkscape-3d20ef63bebcf367ef4907081f5624069d2f7963.tar.gz
inkscape-3d20ef63bebcf367ef4907081f5624069d2f7963.zip
Revert "c++11 refactor: ifdef CPP11 -> std::forward"
This reverts commit f9500954af2d6130069087970f8ed97ab61d13c2.
Diffstat (limited to 'src')
-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.