Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] problem with BOOST_RESULT_OF_USE_DECLTYPE

Subject: CGAL users discussion list

List archive

[cgal-discuss] problem with BOOST_RESULT_OF_USE_DECLTYPE


Chronological Thread 
  • From: Cody Rose <>
  • To:
  • Subject: [cgal-discuss] problem with BOOST_RESULT_OF_USE_DECLTYPE
  • Date: Tue, 29 Jan 2013 11:39:34 -0800

Hello,

With CGAL 4.1 I am unable to use the Nef_polyhedron_3 package with BOOST_RESULT_OF_USE_DECLTYPE defined. I am using:

CGAL 4.1
the CORE numeric library, along with its dependencies (GMP etc)
Boost 1.47
Visual Studio 2010

The problem does *not* appear in CGAL 3.9. The following code reproduces the problem for me:

// This is the problematic define.
#define BOOST_RESULT_OF_USE_DECLTYPE

#include <vector>

#include <boost/range/algorithm.hpp>
#include <boost/range/adaptors.hpp>

#include <CGAL/Cartesian.h>
#include <CGAL/CORE_Expr.h>
#include <CGAL/Nef_polyhedron_3.h>

typedef CORE::Expr NT;
typedef CGAL::Cartesian<NT> K;
typedef CGAL::Nef_polyhedron_3<K> nef_polyhedron_3;

int main() {
std::vector<int> a(0, 3);
a[0] = 1;
a[1] = 2;
a[3] = 3;
std::vector<int> b;

// With BOOST_RESULT_OF_USE_DECLTYPE defined, the following line causes an error.
nef_polyhedron_3 foo;
// Without BOOST_RESULT_OF_USE_DECLTYPE defined, the following line causes an error.
boost::copy(a | boost::adaptors::transformed([](int x) { return x * 2; }), std::back_inserter(b));
return 0;
}

Thank you,
Cody Rose



Archive powered by MHonArc 2.6.18.

Top of Page