Skip to content

Commit b02cdc2

Browse files
committed
Cleaning boost concepts usage 1 (/ ???)
1 parent b28ccfa commit b02cdc2

33 files changed

Lines changed: 38 additions & 128 deletions

examples/geometry/tools/exampleAlphaShape.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ Computation of the alpha shape of the border of a digital shape.
4141
///////////////////////////////////////////////////////////////////////////////
4242
#include <iostream>
4343
#include "DGtal/base/Common.h"
44+
#include "DGtal/base/ConceptUtils.h"
4445
#include "DGtal/base/IteratorCirculatorTraits.h"
4546
#include "DGtal/helpers/StdDefs.h"
4647

@@ -76,11 +77,11 @@ using namespace DGtal;
7677
* @tparam Board equivalent to Board2D
7778
*/
7879
template <typename ForwardIterator, typename Board>
80+
requires concepts::ConceptUtils::ForwardTraversal<ForwardIterator> &&
81+
concepts::ConceptUtils::ReadableIterator<ForwardIterator>
7982
void drawPolygon(const ForwardIterator& itb, const ForwardIterator& ite,
8083
Board& aBoard, bool isClosed = true)
8184
{
82-
BOOST_CONCEPT_ASSERT(( boost_concepts::ForwardTraversalConcept<ForwardIterator> ));
83-
BOOST_CONCEPT_ASSERT(( boost_concepts::ReadableIteratorConcept<ForwardIterator> ));
8485
typedef typename IteratorCirculatorTraits<ForwardIterator>::Value Point;
8586

8687
ForwardIterator it = itb;

examples/geometry/tools/exampleConvexHull2D.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ Computation of the convex hull of a planar point set by different algorithms:
4242
///////////////////////////////////////////////////////////////////////////////
4343
#include <iostream>
4444
#include "DGtal/base/Common.h"
45+
#include "DGtal/base/ConceptUtils.h"
4546
#include "DGtal/base/IteratorCirculatorTraits.h"
4647
#include "DGtal/helpers/StdDefs.h"
4748

@@ -76,11 +77,11 @@ using namespace DGtal;
7677
* @tparam Board equivalent to Board2D
7778
*/
7879
template <typename ForwardIterator, typename Board>
80+
requires concepts::ConceptUtils::ForwardTraversal<ForwardIterator> &&
81+
concepts::ConceptUtils::ReadableIterator<ForwardIterator>
7982
void drawPolygon(const ForwardIterator& itb, const ForwardIterator& ite,
8083
Board& aBoard, bool isClosed = true)
8184
{
82-
BOOST_CONCEPT_ASSERT(( boost_concepts::ForwardTraversalConcept<ForwardIterator> ));
83-
BOOST_CONCEPT_ASSERT(( boost_concepts::ReadableIteratorConcept<ForwardIterator> ));
8485
typedef typename IteratorCirculatorTraits<ForwardIterator>::Value Point;
8586

8687
ForwardIterator it = itb;

src/DGtal/arithmetic/IntegerComputer.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,7 @@ It is a backport of \e ImaGene.
313313
@return the gcd of \a a and \a b.
314314
*/
315315
template <typename OutputIterator>
316+
requires concepts::ConceptUtils::OutputIterator< OutputIterator, TInteger >
316317
Integer getCFrac( OutputIterator outIt,
317318
IntegerParamType a, IntegerParamType b ) const;
318319

src/DGtal/arithmetic/IntegerComputer.ih

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -432,15 +432,14 @@ template <typename TInteger>
432432
requires DGtal::concepts::CIntegralNumber<typename DGtal::NumberTraits<TInteger>::UnsignedVersion> &&
433433
DGtal::concepts::CInteger<typename DGtal::NumberTraits<TInteger>::SignedVersion> &&
434434
DGtal::concepts::CUnsignedNumber<typename DGtal::NumberTraits<TInteger>::UnsignedVersion>
435-
436435
template <typename OutputIterator>
436+
requires DGtal::concepts::ConceptUtils::OutputIterator< OutputIterator, TInteger >
437437
inline
438438
typename DGtal::IntegerComputer<TInteger>::Integer
439439
DGtal::IntegerComputer<TInteger>::
440440
getCFrac( OutputIterator outIt,
441441
IntegerParamType a, IntegerParamType b ) const
442442
{
443-
BOOST_CONCEPT_ASSERT(( boost::OutputIterator< OutputIterator, Integer > ));
444443
ASSERT( isPositiveOrZero( a ) && isPositiveOrZero( b ) );
445444
_m_a0 = a;
446445
_m_a1 = b;

src/DGtal/arithmetic/Pattern.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,6 @@ namespace DGtal
8484
typedef typename Fraction::Integer Integer;
8585
typedef typename Fraction::Quotient Quotient;
8686

87-
// BOOST_CONCEPT_ASSERT(( CInteger< Quotient > ));
88-
8987
// ----------------------- associated types ------------------------------
9088
public:
9189

src/DGtal/arithmetic/StandardDSLQ0.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,7 @@ namespace DGtal
8585
typedef typename Fraction::Integer Integer;
8686
typedef typename Fraction::UnsignedInteger UnsignedInteger;
8787
typedef typename Fraction::Quotient Quotient;
88-
89-
// BOOST_CONCEPT_ASSERT(( CFraction<Fraction> ));
90-
88+
9189
typedef IntegerComputer<Integer> IC;
9290
typedef typename IC::IntegerParamType IntegerParamType;
9391
typedef typename IC::Vector2I Vector2I;

src/DGtal/base/BasicFunctors.h

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -497,12 +497,10 @@ namespace DGtal
497497
*
498498
*/
499499
template <typename T, bool isLower = true, bool isEqual = true >
500+
requires std::totally_ordered<T>
500501
class Thresholder
501502
{
502503
public:
503-
BOOST_CONCEPT_ASSERT(( boost::EqualityComparable<T> ));
504-
BOOST_CONCEPT_ASSERT(( boost::LessThanComparable<T> ));
505-
506504
typedef T Input;
507505

508506
/**
@@ -528,12 +526,10 @@ class Thresholder
528526

529527
//specializations
530528
template <typename T>
529+
requires std::totally_ordered<T>
531530
struct Thresholder<T,false,false>
532531
{
533-
534532
public:
535-
BOOST_CONCEPT_ASSERT(( boost::EqualityComparable<T> ));
536-
BOOST_CONCEPT_ASSERT(( boost::LessThanComparable<T> ));
537533

538534
typedef T Input;
539535

@@ -548,12 +544,10 @@ struct Thresholder<T,false,false>
548544
Input myT;
549545
};
550546
template <typename T>
547+
requires std::totally_ordered<T>
551548
struct Thresholder<T,false,true>
552549
{
553550
public:
554-
BOOST_CONCEPT_ASSERT(( boost::EqualityComparable<T> ));
555-
BOOST_CONCEPT_ASSERT(( boost::LessThanComparable<T> ));
556-
557551
typedef T Input;
558552

559553
Thresholder(const Input& aT = 0):myT(aT) {}
@@ -567,12 +561,10 @@ struct Thresholder<T,false,true>
567561
};
568562

569563
template <typename T>
564+
requires std::totally_ordered<T>
570565
struct Thresholder<T,true,false>
571566
{
572567
public:
573-
BOOST_CONCEPT_ASSERT(( boost::EqualityComparable<T> ));
574-
BOOST_CONCEPT_ASSERT(( boost::LessThanComparable<T> ));
575-
576568
typedef T Input;
577569

578570
Thresholder(const Input& aT = 0):myT(aT) {}
@@ -587,12 +579,10 @@ struct Thresholder<T,true,false>
587579
};
588580

589581
template <typename T>
582+
requires std::totally_ordered<T>
590583
struct Thresholder<T,true,true>
591584
{
592585
public:
593-
BOOST_CONCEPT_ASSERT(( boost::EqualityComparable<T> ));
594-
BOOST_CONCEPT_ASSERT(( boost::LessThanComparable<T> ));
595-
596586
typedef T Input;
597587

598588
Thresholder(const Input& aT = 0):myT(aT) {}
@@ -697,12 +687,10 @@ struct Thresholder<T,true,true>
697687
* @tparam T type for a value that must be equality and less-than comparable
698688
*/
699689
template <typename T>
690+
requires std::totally_ordered<T>
700691
class IntervalThresholder
701692
{
702693
public:
703-
BOOST_CONCEPT_ASSERT(( boost::EqualityComparable<T> ));
704-
BOOST_CONCEPT_ASSERT(( boost::LessThanComparable<T> ));
705-
706694
/// input type
707695
typedef T Input;
708696

@@ -984,4 +972,4 @@ class IntervalThresholder
984972
#endif // !defined BasicFunctors_h
985973

986974
#undef BasicFunctors_RECURSES
987-
#endif // else defined(BasicFunctors_RECURSES)
975+
#endif // else defined(BasicFunctors_RECURSES)

src/DGtal/base/ConceptUtils.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -364,9 +364,7 @@ namespace ConceptUtils
364364
does not compile with current DGtal library.
365365
*/
366366
template<typename T>
367-
concept ForwardContainer =
368-
Container<T> &&
369-
std::equality_comparable<T>;
367+
concept ForwardContainer = Container<T>;
370368

371369
/**
372370
* \brief Equivalent of boost_concepts::ReadableIterator

src/DGtal/base/IteratorFunctions.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ namespace DGtal
106106
* @param n any positive distance
107107
* @tparam IC any model o fiterator or circulator
108108
*/
109-
template<typename IC>
109+
template<concepts::ConceptUtils::ForwardTraversal IC>
110110
inline
111111
void advanceIterator(IC& ic,
112112
typename IteratorCirculatorTraits<IC>::Difference n);
@@ -119,7 +119,7 @@ namespace DGtal
119119
* @param n any positive distance
120120
* @tparam IC any iterator or circulator
121121
*/
122-
template<typename IC>
122+
template<concepts::ConceptUtils::ForwardTraversal IC>
123123
inline
124124
void advanceIterator(IC& ic,
125125
typename IteratorCirculatorTraits<IC>::Difference n,
@@ -145,7 +145,7 @@ namespace DGtal
145145
* @return the size
146146
* @tparam IC any model of iterator or circulator
147147
*/
148-
template<typename IC>
148+
template<concepts::ConceptUtils::ForwardTraversal IC>
149149
inline
150150
typename IteratorCirculatorTraits<IC>::Difference
151151
rangeSize(const IC& itb, const IC& ite);
@@ -159,7 +159,7 @@ namespace DGtal
159159
* @return the size
160160
* @tparam IC any model of iterator or circulator
161161
*/
162-
template<typename IC>
162+
template<concepts::ConceptUtils::ForwardTraversal IC>
163163
inline
164164
typename IteratorCirculatorTraits<IC>::Difference
165165
subRangeSize(const IC& itb, const IC& ite);
@@ -174,7 +174,7 @@ namespace DGtal
174174
* NB: in O(ite-itb)
175175
* @tparam I any iterator
176176
*/
177-
template<typename I>
177+
template<concepts::ConceptUtils::ForwardTraversal I>
178178
inline
179179
typename IteratorCirculatorTraits<I>::Difference
180180
rangeSize(const I& itb, const I& ite, IteratorType /*t*/, ForwardCategory /*c*/);
@@ -188,7 +188,7 @@ namespace DGtal
188188
* NB: linear in the range size
189189
* @tparam C any circulator
190190
*/
191-
template<typename C>
191+
template<concepts::ConceptUtils::ForwardTraversal C>
192192
inline
193193
typename IteratorCirculatorTraits<C>::Difference
194194
rangeSize(const C& cb, const C& ce, CirculatorType /*t*/, ForwardCategory /*c*/);
@@ -234,7 +234,7 @@ namespace DGtal
234234
* @return the middle iterator of the range [ @a itb , @a ite )
235235
* @tparam IC any model iterator or circulator
236236
*/
237-
template<typename IC>
237+
template<concepts::ConceptUtils::ForwardTraversal IC>
238238
inline
239239
IC rangeMiddle(const IC& itb, const IC& ite);
240240

@@ -246,7 +246,7 @@ namespace DGtal
246246
* @return the middle iterator of the subrange [ @a itb , @a ite )
247247
* @tparam IC any model of iterator or circulator
248248
*/
249-
template<typename IC>
249+
template<concepts::ConceptUtils::ForwardTraversal IC>
250250
inline
251251
IC subRangeMiddle(const IC& itb, const IC& ite);
252252

@@ -260,7 +260,7 @@ namespace DGtal
260260
* NB: in O(ite-itb)
261261
* @tparam I any iterator
262262
*/
263-
template<typename I>
263+
template<concepts::ConceptUtils::ForwardTraversal I>
264264
inline
265265
I rangeMiddle(const I& itb, const I& ite, IteratorType /*t*/, ForwardCategory /*c*/);
266266

@@ -273,7 +273,7 @@ namespace DGtal
273273
* NB: linear in the range size
274274
* @tparam C any circulator
275275
*/
276-
template<typename C>
276+
template<concepts::ConceptUtils::ForwardTraversal C>
277277
inline
278278
C rangeMiddle(const C& cb, const C& ce, CirculatorType /*t*/, ForwardCategory /*c*/);
279279

0 commit comments

Comments
 (0)