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:
Laurent Rineau 2021-03-24 15:05:36 +01:00
commit 355ca1dbfd
1 changed files with 9 additions and 5 deletions

View File

@ -55,7 +55,7 @@
# include <tbb/scalable_allocator.h>
#endif
#include <boost/type_traits/is_convertible.hpp>
#include <type_traits>
namespace CGAL {
@ -122,23 +122,27 @@ public:
// Cells
// N.B.: Concurrent_compact_container requires 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> >,
Compact_container<Cell>
>::type Cell_range;
# 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;
#endif
// Vertices
// N.B.: Concurrent_compact_container requires 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> >,
Compact_container<Vertex>
>::type Vertex_range;