Opened 11 years ago

Closed 11 years ago

#6210 closed Bugs (fixed)

interval customization results in compilation errors

Reported by: opium Owned by: Joachim Faulhaber
Milestone: Boost 1.49.0 Component: ICL
Version: Boost 1.47.0 Severity: Problem
Keywords: ICL, interval customization, static_closed bounds, compilation error Cc:

Description

Changing of interval bounds type in example boost/libs/icl/example/custom_interval_/custom_interval.cpp to static_closed leads to:

boost/icl/concept/interval.hpp: In function 'typename boost::enable_if<boost::icl::has_static_bounds<Type>, bool>::type boost::icl::lower_less(const Type&, const Type&) [with Type = MyInterval]': boost/icl/concept/interval.hpp:877: instantiated from 'typename boost::enable_if<boost::icl::is_interval<Type>, bool>::type boost::icl::lower_less_equal(const Type&, const Type&) [with Type = MyInterval]' boost/icl/concept/interval.hpp:1199: instantiated from 'typename boost::enable_if<boost::icl::is_static_closed<Type>, Type>::type boost::icl::right_subtract(Type, const Type&) [with Type = MyInterval]' boost/icl/concept/interval_set.hpp:249: instantiated from 'typename boost::enable_if<boost::icl::is_interval_set<Type>, Type>::type& boost::icl::flip(Type&, const typename Type::segment_type&) [with Type = boost::icl::interval_set<int, std::less, MyInterval, std::allocator>]' boost/icl/concept/interval_associator.hpp:772: instantiated from 'typename boost::enable_if<boost::icl::is_intra_derivative<Type, AssociateT>, Type>::type& boost::icl::operator=(Type&, const OperandT&) [with Type = custom_interval()::MyIntervalSet, OperandT = MyInterval]' custom_interval.cpp:80: instantiated from here boost/icl/concept/interval.hpp:728: error: 'const class MyInterval' has no member named 'lower' boost/icl/concept/interval.hpp:728: error: 'const class MyInterval' has no member named 'lower'

template<>
struct interval_bound_type<MyInterval>     //4.  Finally we define the interval borders.
{                                          //    Choose between static_open         (lo..up)
    typedef interval_bound_type type;      //                   static_left_open    (lo..up]
    BOOST_STATIC_CONSTANT(bound_type, value = interval_bounds::static_closed);//[lo..up)
};     

Change History (3)

comment:1 by anonymous, 11 years ago

Using of insert method with iterator arguments also results in compilation error.

New version of void custom_interval () from the same source file boost/libs/icl/example/custom_interval_/custom_interval.cpp (with interval_bound_type <MyInterval>::value = interval_bounds::static_right_open):

void custom_interval()
{
    // Now we can use class MyInterval with interval containers:
    typedef interval_set<int, std::less, MyInterval> MyIntervalSet;
    MyIntervalSet mySet;
    mySet += MyInterval(1,9);
    cout << mySet << endl;
    mySet.subtract(3) -= 6;
    cout << mySet << "            subtracted 3 and 6\n";
    mySet ^= MyInterval(2,8);
    cout << mySet <<      "  flipped between 2 and 7\n";

    MyIntervalSet::iterator it = mySet.insert (mySet.end (), MyInterval (6, 8));
}

Compilation error:

./boost/icl/concept/interval.hpp: In function 'typename boost::enable_if<boost::icl::is_asymmetric_interval<Type>, bool>::type boost::icl::upper_equal(const Type&, const Type&) [with Type = MyInterval]':
./boost/icl/concept/interval.hpp:894:   instantiated from 'typename boost::enable_if<boost::icl::is_interval<Type>, bool>::type boost::icl::operator==(const Type&, const Type&) [with Type = MyInterval]'
./boost/icl/interval_base_set.hpp:495:   instantiated from 'typename boost::icl::interval_base_set<SubType, DomainT, Compare, Interval, Alloc>::iterator boost::icl::interval_base_set<SubType, DomainT, Compare, Interval, Alloc>::_add(typename std::set<Interval, boost::icl::exclusive_less_than<Interval>, Alloc<Interval> >::iterator, const Interval&) [with SubType = boost::icl::interval_set<int, std::less, MyInterval, std::allocator>, DomainT = int, Compare = std::less, Interval = MyInterval, Alloc = std::allocator]'
./boost/icl/interval_base_set.hpp:239:   instantiated from 'typename std::set<Interval, boost::icl::exclusive_less_than<Interval>, Alloc<Interval> >::iterator boost::icl::interval_base_set<SubType, DomainT, Compare, Interval, Alloc>::add(typename std::set<Interval, boost::icl::exclusive_less_than<Interval>, Alloc<Interval> >::iterator, const Interval&) [with SubType = boost::icl::interval_set<int, std::less, MyInterval, std::allocator>, DomainT = int, Compare = std::less, Interval = MyInterval, Alloc = std::allocator]'
./boost/icl/interval_base_set.hpp:275:   instantiated from 'typename std::set<Interval, boost::icl::exclusive_less_than<Interval>, Alloc<Interval> >::iterator boost::icl::interval_base_set<SubType, DomainT, Compare, Interval, Alloc>::insert(typename std::set<Interval, boost::icl::exclusive_less_than<Interval>, Alloc<Interval> >::iterator, const Interval&) [with SubType = boost::icl::interval_set<int, std::less, MyInterval, std::allocator>, DomainT = int, Compare = std::less, Interval = MyInterval, Alloc = std::allocator]'
custom_interval.cpp:83:   instantiated from here
./boost/icl/concept/interval.hpp:847: error: 'const class MyInterval' has no member named 'upper'
./boost/icl/concept/interval.hpp:847: error: 'const class MyInterval' has no member named 'upper'
./boost/icl/concept/interval.hpp: In function 'typename boost::enable_if<boost::icl::is_asymmetric_interval<Type>, bool>::type boost::icl::lower_equal(const Type&, const Type&) [with Type = MyInterval]':
./boost/icl/concept/interval.hpp:894:   instantiated from 'typename boost::enable_if<boost::icl::is_interval<Type>, bool>::type boost::icl::operator==(const Type&, const Type&) [with Type = MyInterval]'
./boost/icl/interval_base_set.hpp:495:   instantiated from 'typename boost::icl::interval_base_set<SubType, DomainT, Compare, Interval, Alloc>::iterator boost::icl::interval_base_set<SubType, DomainT, Compare, Interval, Alloc>::_add(typename std::set<Interval, boost::icl::exclusive_less_than<Interval>, Alloc<Interval> >::iterator, const Interval&) [with SubType = boost::icl::interval_set<int, std::less, MyInterval, std::allocator>, DomainT = int, Compare = std::less, Interval = MyInterval, Alloc = std::allocator]'
./boost/icl/interval_base_set.hpp:239:   instantiated from 'typename std::set<Interval, boost::icl::exclusive_less_than<Interval>, Alloc<Interval> >::iterator boost::icl::interval_base_set<SubType, DomainT, Compare, Interval, Alloc>::add(typename std::set<Interval, boost::icl::exclusive_less_than<Interval>, Alloc<Interval> >::iterator, const Interval&) [with SubType = boost::icl::interval_set<int, std::less, MyInterval, std::allocator>, DomainT = int, Compare = std::less, Interval = MyInterval, Alloc = std::allocator]'
./boost/icl/interval_base_set.hpp:275:   instantiated from 'typename std::set<Interval, boost::icl::exclusive_less_than<Interval>, Alloc<Interval> >::iterator boost::icl::interval_base_set<SubType, DomainT, Compare, Interval, Alloc>::insert(typename std::set<Interval, boost::icl::exclusive_less_than<Interval>, Alloc<Interval> >::iterator, const Interval&) [with SubType = boost::icl::interval_set<int, std::less, MyInterval, std::allocator>, DomainT = int, Compare = std::less, Interval = MyInterval, Alloc = std::allocator]'
custom_interval.cpp:83:   instantiated from here
./boost/icl/concept/interval.hpp:816: error: 'const class MyInterval' has no member named 'lower'
./boost/icl/concept/interval.hpp:816: error: 'const class MyInterval' has no member named 'lower'

comment:2 by Joachim Faulhaber, 11 years ago

Milestone: To Be DeterminedBoost 1.49.0
Status: newassigned

Thanks for sending in this bug report. I will fix the bug immediately. Regards, Joachim

comment:3 by Joachim Faulhaber, 11 years ago

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.