diff --git a/.travis.yml b/.travis.yml index 981151439f8..08fff7246ba 100644 --- a/.travis.yml +++ b/.travis.yml @@ -63,7 +63,7 @@ before_script: - sudo chmod +x /usr/bin/doxygen - mkdir -p build - cd build -- cmake -DCMAKE_CXX_FLAGS="-std=c++11" -DCGAL_HEADER_ONLY=ON -DQt5_DIR="/opt/qt55/lib/cmake/Qt5" -DQt5Svg_DIR="/opt/qt55/lib/cmake/Qt5Svg" -DQt5OpenGL_DIR="/opt/qt55/lib/cmake/Qt5OpenGL" -DCMAKE_CXX_FLAGS_RELEASE=-DCGAL_NDEBUG -DWITH_examples=ON -DWITH_demos=ON -DWITH_tests=ON .. +- cmake -DCMAKE_CXX_FLAGS="-std=c++1y" -DCGAL_HEADER_ONLY=ON -DQt5_DIR="/opt/qt55/lib/cmake/Qt5" -DQt5Svg_DIR="/opt/qt55/lib/cmake/Qt5Svg" -DQt5OpenGL_DIR="/opt/qt55/lib/cmake/Qt5OpenGL" -DCMAKE_CXX_FLAGS_RELEASE=-DCGAL_NDEBUG -DWITH_examples=ON -DWITH_demos=ON -DWITH_tests=ON .. - make - sudo make install &>/dev/null - cd .. diff --git a/Filtered_kernel/include/CGAL/Lazy.h b/Filtered_kernel/include/CGAL/Lazy.h index 58a6c67f42e..54e558ee7be 100644 --- a/Filtered_kernel/include/CGAL/Lazy.h +++ b/Filtered_kernel/include/CGAL/Lazy.h @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -237,7 +238,7 @@ struct Depth_base { template class Lazy_rep : public Rep, public Depth_base { - Lazy_rep (const Lazy_rep&); // cannot be copied. + Lazy_rep (const Lazy_rep&) = delete; // cannot be copied. public: @@ -247,13 +248,15 @@ public: mutable ET *et; Lazy_rep () - : at(), et(NULL){} + : at(), et(nullptr){} - Lazy_rep (const AT& a) - : at(a), et(NULL){} + template + Lazy_rep (A&& a) + : at(std::forward(a)), et(nullptr){} - Lazy_rep (const AT& a, const ET& e) - : at(a), et(new ET(e)) {} + template + Lazy_rep (A&& a, E&& e) + : at(std::forward(a)), et(new ET(std::forward(e))) {} const AT& approx() const { @@ -332,8 +335,9 @@ class Lazy_rep_n : void update_exact() const { update_exact_helper(std::make_index_sequence{}); } - Lazy_rep_n(const AC& ac, const EC& ec, L const&...ll) : - Lazy_rep(ac(CGAL::approx(ll)...)), EC(ec), l(ll...) + template + Lazy_rep_n(const AC& ac, const EC& ec, LL&&...ll) : + Lazy_rep(ac(CGAL::approx(ll)...)), EC(ec), l(std::forward(ll)...) { this->set_depth(std::max({ -1, (int)CGAL::depth(ll)...}) + 1); } @@ -377,14 +381,23 @@ public: Lazy_rep_0() : Lazy_rep() {} - Lazy_rep_0(const AT& a, const ET& e) - : Lazy_rep(a, e) {} + template + Lazy_rep_0(A&& a, E&& e) + : Lazy_rep(std::forward(a), std::forward(e)) {} +#if 0 + // unused. Find a less ambiguous placeholder if necessary Lazy_rep_0(const AT& a, void*) : Lazy_rep(a) {} +#endif - Lazy_rep_0(const ET& e) - : Lazy_rep(E2A()(e), e) {} + // E2A()(e) and std::forward(e) could be evaluated in any order, but + // that's ok, "forward" itself does not modify e, it may only mark it as + // modifyable by the outer call, which is obviously sequenced after the inner + // call E2A()(e). + template + Lazy_rep_0(E&& e) + : Lazy_rep(E2A()(e), std::forward(e)) {} void print_dag(std::ostream& os, int level) const @@ -722,6 +735,11 @@ public : PTR = new Lazy_rep_0(e); } + Lazy(ET&& e) + { + PTR = new Lazy_rep_0(std::move(e)); + } + const AT& approx() const { return ptr()->approx(); } diff --git a/NewKernel_d/include/CGAL/NewKernel_d/Lazy_cartesian.h b/NewKernel_d/include/CGAL/NewKernel_d/Lazy_cartesian.h index 1912ce7f214..c62f3bbfde4 100644 --- a/NewKernel_d/include/CGAL/NewKernel_d/Lazy_cartesian.h +++ b/NewKernel_d/include/CGAL/NewKernel_d/Lazy_cartesian.h @@ -211,8 +211,6 @@ struct Lazy_cartesian : typedef Lazy_construction_nt type; }; template struct Functor { - typedef typename Get_functor::type FA; - typedef typename Get_functor::type FE; typedef Lazy_construction2 type; }; template struct Functor { diff --git a/NewKernel_d/include/CGAL/NewKernel_d/Wrapper/Point_d.h b/NewKernel_d/include/CGAL/NewKernel_d/Wrapper/Point_d.h index 643828d9733..831ec157762 100644 --- a/NewKernel_d/include/CGAL/NewKernel_d/Wrapper/Point_d.h +++ b/NewKernel_d/include/CGAL/NewKernel_d/Wrapper/Point_d.h @@ -311,7 +311,8 @@ operator>>(std::istream &is, Point_d & p) for(int i=0;i