Skip to content

Commit a29c905

Browse files
committed
Replace BOOST_STATIC_ASSERT by CGAL_static_assertion.
1 parent 3c9b786 commit a29c905

File tree

93 files changed

+339
-362
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+339
-362
lines changed

Algebraic_foundations/examples/Algebraic_foundations/fraction_traits.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ int main(){
1010
typedef FT::Numerator_type Numerator_type;
1111
typedef FT::Denominator_type Denominator_type;
1212

13-
BOOST_STATIC_ASSERT((boost::is_same<Numerator_type,CGAL::Gmpz>::value));
14-
BOOST_STATIC_ASSERT((boost::is_same<Denominator_type,CGAL::Gmpz>::value));
13+
CGAL_static_assertion((boost::is_same<Numerator_type,CGAL::Gmpz>::value));
14+
CGAL_static_assertion((boost::is_same<Denominator_type,CGAL::Gmpz>::value));
1515

1616
Numerator_type numerator;
1717
Denominator_type denominator;

Algebraic_foundations/examples/Algebraic_foundations/interoperable.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ binary_func(const A& a , const B& b){
1010
typedef CGAL::Coercion_traits<A,B> CT;
1111

1212
// check for explicit interoperability
13-
BOOST_STATIC_ASSERT((CT::Are_explicit_interoperable::value));
13+
CGAL_static_assertion((CT::Are_explicit_interoperable::value));
1414

1515
// CT::Cast is used to to convert both types into the coercion type
1616
typename CT::Cast cast;

Algebraic_foundations/include/CGAL/Algebraic_structure_traits.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ class Algebraic_structure_traits_base< Type_,
355355
Type& r ) const {
356356
typedef Coercion_traits< NT1, NT2 > CT;
357357
typedef typename CT::Type Type;
358-
BOOST_STATIC_ASSERT((
358+
CGAL_static_assertion((
359359
::boost::is_same<Type , Type >::value));
360360

361361
typename Coercion_traits< NT1, NT2 >::Cast cast;

Algebraic_foundations/include/CGAL/Coercion_traits.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
#define CGAL_IMPLICIT_INTEROPERABLE_BINARY_OPERATOR_WITH_RT( NT, Result_type ) \
4444
template < class CT_Type_1, class CT_Type_2 > \
4545
Result_type operator()( const CT_Type_1& x, const CT_Type_2& y ) const { \
46-
BOOST_STATIC_ASSERT((::boost::is_same< \
46+
CGAL_static_assertion((::boost::is_same< \
4747
typename Coercion_traits< CT_Type_1, CT_Type_2 >::Type, NT \
4848
>::value)); \
4949
\

Algebraic_foundations/include/CGAL/Scalar_factor_traits.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,13 @@ class Scalar_factor_traits {
9292

9393
// determine extractable scalar factor
9494
Scalar operator () (const NT& a) {
95-
BOOST_STATIC_ASSERT(( ::boost::is_same< NT,Scalar >::value));
95+
CGAL_static_assertion(( ::boost::is_same< NT,Scalar >::value));
9696
typedef typename Algebraic_structure_traits<NT>::Algebraic_category SAT;
9797
return scalar_factor(a, SAT());
9898
}
9999
// determine extractable scalar factor
100100
Scalar operator () (const NT& a, const Scalar& d) {
101-
BOOST_STATIC_ASSERT(( ::boost::is_same< NT,Scalar >::value));
101+
CGAL_static_assertion(( ::boost::is_same< NT,Scalar >::value));
102102
typedef typename Algebraic_structure_traits<NT>::Algebraic_category SAT;
103103
return scalar_factor(a,d,SAT());
104104
}

Algebraic_foundations/include/CGAL/Test/_test_algebraic_structure.h

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#include <CGAL/Algebraic_structure_traits.h>
3232
//#include <CGAL/Real_embeddable_traits.h>
3333

34-
#include <boost/static_assert.hpp>
34+
#include <CGAL/assertions.h>
3535
#include <boost/type_traits.hpp>
3636
#include <CGAL/tags.h>
3737
#include <cassert>
@@ -48,7 +48,7 @@
4848
template <typename AdaptableFunctor, typename ResultType>
4949
void check_result_type(AdaptableFunctor, ResultType){
5050
typedef typename AdaptableFunctor::result_type result_type;
51-
BOOST_STATIC_ASSERT((::boost::is_same<result_type,ResultType>::value));
51+
CGAL_static_assertion((::boost::is_same<result_type,ResultType>::value));
5252
}
5353
// check nothing for CGAL::Null_functor
5454
template <typename ResultType>
@@ -110,12 +110,12 @@ void test_algebraic_structure_intern( const CGAL::Integral_domain_tag& ) {
110110
CGAL_SNAP_AST_FUNCTORS(AST);
111111

112112
using CGAL::Null_functor;
113-
BOOST_STATIC_ASSERT(
113+
CGAL_static_assertion(
114114
(!::boost::is_same< Integral_division, Null_functor >::value));
115-
BOOST_STATIC_ASSERT((!::boost::is_same< Divides, Null_functor >::value));
116-
BOOST_STATIC_ASSERT((!::boost::is_same< Is_zero, Null_functor >::value));
117-
BOOST_STATIC_ASSERT((!::boost::is_same< Is_one, Null_functor >::value));
118-
BOOST_STATIC_ASSERT((!::boost::is_same< Square, Null_functor >::value));
115+
CGAL_static_assertion((!::boost::is_same< Divides, Null_functor >::value));
116+
CGAL_static_assertion((!::boost::is_same< Is_zero, Null_functor >::value));
117+
CGAL_static_assertion((!::boost::is_same< Is_one, Null_functor >::value));
118+
CGAL_static_assertion((!::boost::is_same< Square, Null_functor >::value));
119119

120120
// functor
121121
const Is_zero is_zero = Is_zero();
@@ -194,7 +194,7 @@ void test_algebraic_structure_intern(
194194
CGAL_SNAP_AST_FUNCTORS(AST);
195195

196196
using CGAL::Null_functor;
197-
BOOST_STATIC_ASSERT((!::boost::is_same< Gcd, Null_functor>::value));
197+
CGAL_static_assertion((!::boost::is_same< Gcd, Null_functor>::value));
198198

199199
const Gcd gcd = Gcd();
200200
assert( gcd( AS ( 0), AS ( 0)) == unit_normal( AS (0) ) );
@@ -256,9 +256,9 @@ void test_algebraic_structure_intern( const CGAL::Euclidean_ring_tag&) {
256256
CGAL_SNAP_AST_FUNCTORS(AST);
257257

258258
using CGAL::Null_functor;
259-
BOOST_STATIC_ASSERT((!::boost::is_same< Div, Null_functor>::value));
260-
BOOST_STATIC_ASSERT((!::boost::is_same< Mod, Null_functor>::value));
261-
BOOST_STATIC_ASSERT((!::boost::is_same< Div_mod, Null_functor>::value));
259+
CGAL_static_assertion((!::boost::is_same< Div, Null_functor>::value));
260+
CGAL_static_assertion((!::boost::is_same< Mod, Null_functor>::value));
261+
CGAL_static_assertion((!::boost::is_same< Div_mod, Null_functor>::value));
262262

263263
const Div div=Div();
264264
const Mod mod=Mod();
@@ -374,7 +374,7 @@ void test_algebraic_structure_intern( const CGAL::Field_with_sqrt_tag& ) {
374374

375375
CGAL_SNAP_AST_FUNCTORS(AST);
376376

377-
BOOST_STATIC_ASSERT((!::boost::is_same< Sqrt, Null_functor>::value));
377+
CGAL_static_assertion((!::boost::is_same< Sqrt, Null_functor>::value));
378378
const Sqrt sqrt =Sqrt();
379379
AS a(4);
380380

@@ -597,11 +597,11 @@ class Test_is_square {
597597
typedef typename Is_square::first_argument_type First_argument_type;
598598
typedef typename Is_square::second_argument_type Second_argument_type;
599599
typedef typename Is_square::result_type Result_type;
600-
BOOST_STATIC_ASSERT(
600+
CGAL_static_assertion(
601601
( ::boost::is_same< AS , First_argument_type>::value));
602-
BOOST_STATIC_ASSERT(
602+
CGAL_static_assertion(
603603
( ::boost::is_same< AS& , Second_argument_type>::value));
604-
//BOOST_STATIC_ASSERT(( ::boost::is_same< bool , Result_type>::value));
604+
//CGAL_static_assertion(( ::boost::is_same< bool , Result_type>::value));
605605
bool b = Result_type(true); CGAL_USE(b);
606606

607607
AS test_number = AS(3)*AS(3);
@@ -630,8 +630,8 @@ class Test_sqrt {
630630
void operator() (const Sqrt& sqrt) {
631631
typedef typename Sqrt::argument_type Argument_type;
632632
typedef typename Sqrt::result_type Result_type;
633-
BOOST_STATIC_ASSERT(( ::boost::is_same< AS , Argument_type>::value));
634-
BOOST_STATIC_ASSERT(( ::boost::is_same< AS , Result_type>::value));
633+
CGAL_static_assertion(( ::boost::is_same< AS , Argument_type>::value));
634+
CGAL_static_assertion(( ::boost::is_same< AS , Result_type>::value));
635635
typedef Algebraic_structure_traits<AS> AST;
636636
typedef typename AST::Is_exact Is_exact;
637637
assert( !Is_exact::value || AS (3) == sqrt( AS (9)));
@@ -653,11 +653,11 @@ class Test_root {
653653
typedef typename Root::first_argument_type First_argument_type;
654654
typedef typename Root::second_argument_type Second_argument_type;
655655
typedef typename Root::result_type Result_type;
656-
BOOST_STATIC_ASSERT(
656+
CGAL_static_assertion(
657657
( ::boost::is_same<int, First_argument_type>::value));
658-
BOOST_STATIC_ASSERT(
658+
CGAL_static_assertion(
659659
( ::boost::is_same< AS , Second_argument_type>::value));
660-
BOOST_STATIC_ASSERT(
660+
CGAL_static_assertion(
661661
( ::boost::is_same< AS , Result_type>::value));
662662
AS epsilon(1);
663663
assert( test_equality_epsilon( AS (2),
@@ -781,7 +781,7 @@ void test_algebraic_structure(){
781781
typedef CGAL::Algebraic_structure_traits< AS > AST;
782782
CGAL_SNAP_AST_FUNCTORS(AST);
783783

784-
BOOST_STATIC_ASSERT((::boost::is_same<AS,typename AST::Type>::value));
784+
CGAL_static_assertion((::boost::is_same<AS,typename AST::Type>::value));
785785

786786
typedef typename AST::Boolean Boolean;
787787
assert(!Boolean());
@@ -794,14 +794,14 @@ void test_algebraic_structure(){
794794
using CGAL::Integral_domain_without_division_tag;
795795
using CGAL::Null_functor;
796796
// Test for desired exactness
797-
BOOST_STATIC_ASSERT(
797+
CGAL_static_assertion(
798798
( ::boost::is_same< typename AST::Is_exact, Is_exact >::value));
799799

800-
BOOST_STATIC_ASSERT(( ::boost::is_convertible< Tag,
800+
CGAL_static_assertion(( ::boost::is_convertible< Tag,
801801
Integral_domain_without_division_tag >::value ));
802-
BOOST_STATIC_ASSERT(( ::boost::is_same< Tag, Algebraic_category>::value));
803-
BOOST_STATIC_ASSERT((!::boost::is_same< Simplify, Null_functor>::value));
804-
BOOST_STATIC_ASSERT((!::boost::is_same< Unit_part, Null_functor>::value));
802+
CGAL_static_assertion(( ::boost::is_same< Tag, Algebraic_category>::value));
803+
CGAL_static_assertion((!::boost::is_same< Simplify, Null_functor>::value));
804+
CGAL_static_assertion((!::boost::is_same< Unit_part, Null_functor>::value));
805805
const Simplify simplify=Simplify();;
806806
const Unit_part unit_part= Unit_part();
807807

@@ -919,7 +919,7 @@ void test_algebraic_structure( const AS & a, const AS & b, const AS & c) {
919919

920920
typedef CGAL::Algebraic_structure_traits<AS> AST;
921921
typedef typename AST::Is_numerical_sensitive Is_numerical_sensitive;
922-
BOOST_STATIC_ASSERT(
922+
CGAL_static_assertion(
923923
!(::boost::is_same<Is_numerical_sensitive, CGAL::Null_tag>::value));
924924
}
925925

Algebraic_foundations/include/CGAL/Test/_test_coercion_traits.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ void test_implicit_interoperable_one_way() {
329329
typedef typename CT::Type C;
330330
typedef typename CT::Are_implicit_interoperable Are_implicit_interoperable;
331331

332-
BOOST_STATIC_ASSERT(
332+
CGAL_static_assertion(
333333
(::boost::is_same<Are_implicit_interoperable, CGAL::Tag_true>::value));
334334
assert((::boost::is_same<Are_implicit_interoperable, CGAL::Tag_true>::value));
335335

@@ -349,9 +349,9 @@ void test_explicit_interoperable_one_way(){
349349
typedef typename CT::Cast Cast;
350350
typedef typename Cast::result_type result_type;
351351

352-
BOOST_STATIC_ASSERT((::boost::is_same<result_type,Type>::value));
353-
BOOST_STATIC_ASSERT((::boost::is_same< typename CT::Are_explicit_interoperable,CGAL::Tag_true>::value));
354-
BOOST_STATIC_ASSERT((::boost::is_same<Type,RT>::value));
352+
CGAL_static_assertion((::boost::is_same<result_type,Type>::value));
353+
CGAL_static_assertion((::boost::is_same< typename CT::Are_explicit_interoperable,CGAL::Tag_true>::value));
354+
CGAL_static_assertion((::boost::is_same<Type,RT>::value));
355355
typename CT::Cast cast;
356356

357357
A a(3);

Algebraic_foundations/include/CGAL/Test/_test_fraction_traits.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ void test_fraction_traits(){
4444
typedef typename FT::Decompose Decompose;
4545
typedef typename FT::Compose Compose;
4646

47-
BOOST_STATIC_ASSERT( (::boost::is_same<Type,T>::value));
48-
BOOST_STATIC_ASSERT( (::boost::is_same<Is_fraction,Tag_true>::value));
49-
BOOST_STATIC_ASSERT(!(::boost::is_same<Common_factor,Null_functor>::value));
50-
BOOST_STATIC_ASSERT(!(::boost::is_same<Decompose,Null_functor>::value));
51-
BOOST_STATIC_ASSERT(!(::boost::is_same<Compose,Null_functor>::value));
47+
CGAL_static_assertion( (::boost::is_same<Type,T>::value));
48+
CGAL_static_assertion( (::boost::is_same<Is_fraction,Tag_true>::value));
49+
CGAL_static_assertion(!(::boost::is_same<Common_factor,Null_functor>::value));
50+
CGAL_static_assertion(!(::boost::is_same<Decompose,Null_functor>::value));
51+
CGAL_static_assertion(!(::boost::is_same<Compose,Null_functor>::value));
5252

5353

5454
// Decompose

Algebraic_foundations/include/CGAL/Test/_test_rational_traits.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ void test_rational_traits(){
3838

3939
typedef Rational_traits<Rational> Rational_traits;
4040
typedef typename Rational_traits::RT RT;
41-
BOOST_STATIC_ASSERT((::boost::is_same<RT,RT>::value));
41+
CGAL_static_assertion((::boost::is_same<RT,RT>::value));
4242

4343
assert( Rational_traits().numerator(x) == RT(7));
4444
assert( Rational_traits().denominator(x) == RT(2));

Algebraic_foundations/include/CGAL/Test/_test_real_embeddable.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#include <CGAL/basic.h>
2727

2828
#include <cstddef>
29-
#include <boost/static_assert.hpp>
29+
#include <CGAL/assertions.h>
3030
#include <boost/type_traits.hpp>
3131

3232
#include <cassert>
@@ -58,8 +58,8 @@ namespace CGAL {
5858
void operator() (const ToDouble& to_double) {
5959
typedef typename ToDouble::argument_type Argument_type;
6060
typedef typename ToDouble::result_type Result_type;
61-
BOOST_STATIC_ASSERT(( ::boost::is_same<Type, Argument_type>::value));
62-
BOOST_STATIC_ASSERT(( ::boost::is_same<double, Result_type>::value));
61+
CGAL_static_assertion(( ::boost::is_same<Type, Argument_type>::value));
62+
CGAL_static_assertion(( ::boost::is_same<double, Result_type>::value));
6363
assert(42.0 == to_double(Type(42)));
6464
}
6565
};
@@ -79,8 +79,8 @@ namespace CGAL {
7979
typedef typename To_interval::argument_type Argument_type;
8080
typedef typename To_interval::result_type Result_type;
8181
typedef std::pair<double,double> Interval_type;
82-
BOOST_STATIC_ASSERT(( ::boost::is_same<Type, Argument_type>::value));
83-
BOOST_STATIC_ASSERT(( ::boost::is_same<Interval_type, Result_type>::value));
82+
CGAL_static_assertion(( ::boost::is_same<Type, Argument_type>::value));
83+
CGAL_static_assertion(( ::boost::is_same<Interval_type, Result_type>::value));
8484

8585
// assert(NiX::in(42.0,to_Interval(Type(42))));
8686
// Instead of 'NiX::in':
@@ -145,7 +145,7 @@ void test_real_embeddable() {
145145
CGAL_SNAP_RET_FUNCTORS(RET);
146146
typedef typename RET::Is_real_embeddable Is_real_embeddable;
147147
using CGAL::Tag_true;
148-
BOOST_STATIC_ASSERT(( ::boost::is_same< Is_real_embeddable, Tag_true>::value));
148+
CGAL_static_assertion(( ::boost::is_same< Is_real_embeddable, Tag_true>::value));
149149

150150
typedef typename RET::Boolean Boolean;
151151
typedef typename RET::Sign Sign;
@@ -251,20 +251,20 @@ void test_not_real_embeddable() {
251251
typedef CGAL::Real_embeddable_traits<Type> RET;
252252
typedef typename RET::Is_real_embeddable Is_real_embeddable;
253253
using CGAL::Tag_false;
254-
BOOST_STATIC_ASSERT(( ::boost::is_same< Is_real_embeddable, Tag_false>::value));
254+
CGAL_static_assertion(( ::boost::is_same< Is_real_embeddable, Tag_false>::value));
255255
}
256256

257257

258258
//template <class Type, class CeilLog2Abs>
259259
//void test_rounded_log2_abs(Type zero, CGAL::Null_functor, CeilLog2Abs) {
260260
// typedef CGAL::Null_functor Null_functor;
261-
// BOOST_STATIC_ASSERT(( ::boost::is_same< CeilLog2Abs, Null_functor>::value));
261+
// CGAL_static_assertion(( ::boost::is_same< CeilLog2Abs, Null_functor>::value));
262262
//}
263263
//
264264
//template <class Type, class FloorLog2Abs, class CeilLog2Abs>
265265
//void test_rounded_log2_abs(Type zero, FloorLog2Abs fl_log, CeilLog2Abs cl_log) {
266266
// typedef CGAL::Null_functor Null_functor;
267-
// BOOST_STATIC_ASSERT((!::boost::is_same< CeilLog2Abs, Null_functor>::value));
267+
// CGAL_static_assertion((!::boost::is_same< CeilLog2Abs, Null_functor>::value));
268268
//
269269
// assert( fl_log(Type( 7)) == 2 );
270270
// assert( cl_log(Type( 7)) == 3 );

0 commit comments

Comments
 (0)