2
0
mirror of https://github.com/boostorg/icl.git synced 2026-01-19 04:12:13 +00:00

added missing includes for concept check

This commit is contained in:
jofaber
2021-05-09 20:05:23 +02:00
parent b8a4dda090
commit 663c63641d
4 changed files with 40 additions and 33 deletions

View File

@@ -8,15 +8,19 @@ Copyright (c) 2010-2010: Joachim Faulhaber
#ifndef BOOST_ICL_CLOSED_INTERVAL_HPP_JOFA_100324
#define BOOST_ICL_CLOSED_INTERVAL_HPP_JOFA_100324
#include <functional>
#include <boost/static_assert.hpp>
#include <boost/concept/assert.hpp>
#include <boost/icl/detail/concept_check.hpp>
#include <boost/icl/concept/interval.hpp>
#include <boost/icl/type_traits/succ_pred.hpp>
#include <boost/icl/type_traits/value_size.hpp>
#include <boost/icl/type_traits/type_to_string.hpp>
namespace boost{namespace icl
{
template <class DomainT,
template <class DomainT,
ICL_COMPARE Compare = ICL_COMPARE_INSTANCE(ICL_COMPARE_DEFAULT, DomainT)>
class closed_interval
{
@@ -30,8 +34,8 @@ public:
//= Construct, copy, destruct
//==========================================================================
/** Default constructor; yields an empty interval <tt>[0,0)</tt>. */
closed_interval()
: _lwb(unit_element<DomainT>::value()), _upb(identity_element<DomainT>::value())
closed_interval()
: _lwb(unit_element<DomainT>::value()), _upb(identity_element<DomainT>::value())
{
BOOST_CONCEPT_ASSERT((DefaultConstructibleConcept<DomainT>));
BOOST_CONCEPT_ASSERT((LessThanComparableConcept<DomainT>));
@@ -91,7 +95,7 @@ struct interval_traits< icl::closed_interval<DomainT, Compare> >
//==============================================================================
//= Type traits
//==============================================================================
template <class DomainT, ICL_COMPARE Compare>
template <class DomainT, ICL_COMPARE Compare>
struct interval_bound_type< closed_interval<DomainT,Compare> >
{
typedef interval_bound_type type;
@@ -105,14 +109,13 @@ struct type_to_string<icl::closed_interval<DomainT,Compare> >
{ return "[I]<"+ type_to_string<DomainT>::apply() +">"; }
};
template<class DomainT>
template<class DomainT>
struct value_size<icl::closed_interval<DomainT> >
{
static std::size_t apply(const icl::closed_interval<DomainT>&)
static std::size_t apply(const icl::closed_interval<DomainT>&)
{ return 2; }
};
}} // namespace icl boost
#endif

View File

@@ -9,15 +9,18 @@ Copyright (c) 2010-2010: Joachim Faulhaber
#define BOOST_ICL_LEFT_OPEN_INTERVAL_HPP_JOFA_100930
#include <functional>
#include <boost/static_assert.hpp>
#include <boost/concept/assert.hpp>
#include <boost/icl/detail/concept_check.hpp>
#include <boost/icl/concept/interval.hpp>
#include <boost/icl/type_traits/succ_pred.hpp>
#include <boost/icl/type_traits/value_size.hpp>
#include <boost/icl/type_traits/type_to_string.hpp>
namespace boost{namespace icl
{
template <class DomainT,
template <class DomainT,
ICL_COMPARE Compare = ICL_COMPARE_INSTANCE(ICL_COMPARE_DEFAULT, DomainT)>
class left_open_interval
{
@@ -31,8 +34,8 @@ public:
//= Construct, copy, destruct
//==========================================================================
/** Default constructor; yields an empty interval <tt>(0,0]</tt>. */
left_open_interval()
: _lwb(identity_element<DomainT>::value()), _upb(identity_element<DomainT>::value())
left_open_interval()
: _lwb(identity_element<DomainT>::value()), _upb(identity_element<DomainT>::value())
{
BOOST_CONCEPT_ASSERT((DefaultConstructibleConcept<DomainT>));
BOOST_CONCEPT_ASSERT((LessThanComparableConcept<DomainT>));
@@ -46,11 +49,11 @@ public:
{
BOOST_CONCEPT_ASSERT((DefaultConstructibleConcept<DomainT>));
BOOST_CONCEPT_ASSERT((LessThanComparableConcept<DomainT>));
// Only for discrete types this ctor creates an interval containing
// Only for discrete types this ctor creates an interval containing
// a single element only.
BOOST_STATIC_ASSERT((icl::is_discrete<DomainT>::value));
BOOST_ASSERT((numeric_minimum<DomainT, domain_compare, is_numeric<DomainT>::value >
::is_less_than(val) ));
::is_less_than(val) ));
}
/** Interval from <tt>low</tt> to <tt>up</tt> with bounds <tt>bounds</tt> */
@@ -92,7 +95,7 @@ struct interval_traits< icl::left_open_interval<DomainT, Compare> >
//==============================================================================
//= Type traits
//==============================================================================
template <class DomainT, ICL_COMPARE Compare>
template <class DomainT, ICL_COMPARE Compare>
struct interval_bound_type< left_open_interval<DomainT,Compare> >
{
typedef interval_bound_type type;
@@ -106,14 +109,13 @@ struct type_to_string<icl::left_open_interval<DomainT,Compare> >
{ return "(I]<"+ type_to_string<DomainT>::apply() +">"; }
};
template<class DomainT, ICL_COMPARE Compare>
template<class DomainT, ICL_COMPARE Compare>
struct value_size<icl::left_open_interval<DomainT,Compare> >
{
static std::size_t apply(const icl::left_open_interval<DomainT>&)
static std::size_t apply(const icl::left_open_interval<DomainT>&)
{ return 2; }
};
}} // namespace icl boost
#endif

View File

@@ -9,16 +9,18 @@ Copyright (c) 2010-2010: Joachim Faulhaber
#define BOOST_ICL_OPEN_INTERVAL_HPP_JOFA_100930
#include <functional>
#include <boost/static_assert.hpp>
#include <boost/concept/assert.hpp>
#include <boost/icl/detail/concept_check.hpp>
#include <boost/icl/concept/interval.hpp>
#include <boost/icl/type_traits/succ_pred.hpp>
#include <boost/icl/type_traits/value_size.hpp>
#include <boost/icl/type_traits/type_to_string.hpp>
namespace boost{namespace icl
{
template <class DomainT,
template <class DomainT,
ICL_COMPARE Compare = ICL_COMPARE_INSTANCE(ICL_COMPARE_DEFAULT, DomainT)>
class open_interval
{
@@ -32,8 +34,8 @@ public:
//= Construct, copy, destruct
//==========================================================================
/** Default constructor; yields an empty interval <tt>(0,0)</tt>. */
open_interval()
: _lwb(identity_element<DomainT>::value()), _upb(identity_element<DomainT>::value())
open_interval()
: _lwb(identity_element<DomainT>::value()), _upb(identity_element<DomainT>::value())
{
BOOST_CONCEPT_ASSERT((DefaultConstructibleConcept<DomainT>));
BOOST_CONCEPT_ASSERT((LessThanComparableConcept<DomainT>));
@@ -47,11 +49,11 @@ public:
{
BOOST_CONCEPT_ASSERT((DefaultConstructibleConcept<DomainT>));
BOOST_CONCEPT_ASSERT((LessThanComparableConcept<DomainT>));
// Only for discrete types this ctor creates an interval containing
// Only for discrete types this ctor creates an interval containing
// a single element only.
BOOST_STATIC_ASSERT((icl::is_discrete<DomainT>::value));
BOOST_ASSERT((numeric_minimum<DomainT, domain_compare, is_numeric<DomainT>::value >
::is_less_than(val) ));
::is_less_than(val) ));
}
/** Interval from <tt>low</tt> to <tt>up</tt> with bounds <tt>bounds</tt> */
@@ -93,7 +95,7 @@ struct interval_traits< icl::open_interval<DomainT, Compare> >
//==============================================================================
//= Type traits
//==============================================================================
template <class DomainT, ICL_COMPARE Compare>
template <class DomainT, ICL_COMPARE Compare>
struct interval_bound_type< open_interval<DomainT,Compare> >
{
typedef interval_bound_type type;
@@ -107,14 +109,13 @@ struct type_to_string<icl::open_interval<DomainT,Compare> >
{ return "(I)<"+ type_to_string<DomainT>::apply() +">"; }
};
template<class DomainT, ICL_COMPARE Compare>
template<class DomainT, ICL_COMPARE Compare>
struct value_size<icl::open_interval<DomainT,Compare> >
{
static std::size_t apply(const icl::open_interval<DomainT>&)
static std::size_t apply(const icl::open_interval<DomainT>&)
{ return 2; }
};
}} // namespace icl boost
#endif

View File

@@ -9,7 +9,9 @@ Copyright (c) 2010-2010: Joachim Faulhaber
#define BOOST_ICL_RIGHT_OPEN_INTERVAL_HPP_JOFA_100323
#include <functional>
#include <boost/static_assert.hpp>
#include <boost/concept/assert.hpp>
#include <boost/icl/detail/concept_check.hpp>
#include <boost/icl/concept/interval.hpp>
#include <boost/icl/type_traits/succ_pred.hpp>
#include <boost/icl/type_traits/value_size.hpp>
@@ -18,7 +20,7 @@ Copyright (c) 2010-2010: Joachim Faulhaber
namespace boost{namespace icl
{
template <class DomainT,
template <class DomainT,
ICL_COMPARE Compare = ICL_COMPARE_INSTANCE(ICL_COMPARE_DEFAULT, DomainT)>
class right_open_interval
{
@@ -32,8 +34,8 @@ public:
//= Construct, copy, destruct
//==========================================================================
/** Default constructor; yields an empty interval <tt>[0,0)</tt>. */
right_open_interval()
: _lwb(identity_element<DomainT>::value()), _upb(identity_element<DomainT>::value())
right_open_interval()
: _lwb(identity_element<DomainT>::value()), _upb(identity_element<DomainT>::value())
{
BOOST_CONCEPT_ASSERT((DefaultConstructibleConcept<DomainT>));
BOOST_CONCEPT_ASSERT((LessThanComparableConcept<DomainT>));
@@ -47,7 +49,7 @@ public:
{
BOOST_CONCEPT_ASSERT((DefaultConstructibleConcept<DomainT>));
BOOST_CONCEPT_ASSERT((LessThanComparableConcept<DomainT>));
// Only for discrete types this ctor creates an interval containing
// Only for discrete types this ctor creates an interval containing
// a single element only.
BOOST_STATIC_ASSERT((icl::is_discrete<DomainT>::value));
}
@@ -91,7 +93,7 @@ struct interval_traits< icl::right_open_interval<DomainT, Compare> >
//==============================================================================
//= Type traits
//==============================================================================
template <class DomainT, ICL_COMPARE Compare>
template <class DomainT, ICL_COMPARE Compare>
struct interval_bound_type< right_open_interval<DomainT,Compare> >
{
typedef interval_bound_type type;
@@ -105,14 +107,13 @@ struct type_to_string<icl::right_open_interval<DomainT,Compare> >
{ return "[I)<"+ type_to_string<DomainT>::apply() +">"; }
};
template<class DomainT, ICL_COMPARE Compare>
template<class DomainT, ICL_COMPARE Compare>
struct value_size<icl::right_open_interval<DomainT,Compare> >
{
static std::size_t apply(const icl::right_open_interval<DomainT>&)
static std::size_t apply(const icl::right_open_interval<DomainT>&)
{ return 2; }
};
}} // namespace icl boost
#endif