mirror of https://github.com/CGAL/cgal
Merge pull request #5380 from lrineau/Triangulation_3-compilation_error_if_Parallel_tag_without_TBB-GF
Triangulation_3: Add a static assert so that Parallel_tag can only be used with TBB
This commit is contained in:
commit
355ca1dbfd
|
|
@ -55,7 +55,7 @@
|
||||||
# include <tbb/scalable_allocator.h>
|
# include <tbb/scalable_allocator.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <boost/type_traits/is_convertible.hpp>
|
#include <type_traits>
|
||||||
|
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
|
|
||||||
|
|
@ -122,23 +122,27 @@ public:
|
||||||
// Cells
|
// Cells
|
||||||
// N.B.: Concurrent_compact_container requires TBB
|
// N.B.: Concurrent_compact_container requires TBB
|
||||||
#ifdef CGAL_LINKED_WITH_TBB
|
#ifdef CGAL_LINKED_WITH_TBB
|
||||||
typedef typename boost::mpl::if_c
|
typedef typename std::conditional
|
||||||
<
|
<
|
||||||
boost::is_convertible<Concurrency_tag, Parallel_tag>::value,
|
std::is_convertible<Concurrency_tag, Parallel_tag>::value,
|
||||||
Concurrent_compact_container<Cell, tbb::scalable_allocator<Cell> >,
|
Concurrent_compact_container<Cell, tbb::scalable_allocator<Cell> >,
|
||||||
Compact_container<Cell>
|
Compact_container<Cell>
|
||||||
>::type Cell_range;
|
>::type Cell_range;
|
||||||
|
|
||||||
# else
|
# else
|
||||||
|
CGAL_static_assertion_msg
|
||||||
|
(!(std::is_convertible<Concurrency_tag, Parallel_tag>::value),
|
||||||
|
"In CGAL triangulations, `Parallel_tag` can only be used with the Intel TBB library. "
|
||||||
|
"Make TBB available in the build system and then define the macro `CGAL_LINKED_WITH_TBB`.");
|
||||||
typedef Compact_container<Cell> Cell_range;
|
typedef Compact_container<Cell> Cell_range;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Vertices
|
// Vertices
|
||||||
// N.B.: Concurrent_compact_container requires TBB
|
// N.B.: Concurrent_compact_container requires TBB
|
||||||
#ifdef CGAL_LINKED_WITH_TBB
|
#ifdef CGAL_LINKED_WITH_TBB
|
||||||
typedef typename boost::mpl::if_c
|
typedef typename std::conditional
|
||||||
<
|
<
|
||||||
boost::is_convertible<Concurrency_tag, Parallel_tag>::value,
|
std::is_convertible<Concurrency_tag, Parallel_tag>::value,
|
||||||
Concurrent_compact_container<Vertex, tbb::scalable_allocator<Vertex> >,
|
Concurrent_compact_container<Vertex, tbb::scalable_allocator<Vertex> >,
|
||||||
Compact_container<Vertex>
|
Compact_container<Vertex>
|
||||||
>::type Vertex_range;
|
>::type Vertex_range;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue