Opened 12 years ago
Closed 12 years ago
#4355 closed Patches (fixed)
without namespace 'range_detail'
Reported by: | Owned by: | Neil Groves | |
---|---|---|---|
Milestone: | Boost 1.46.0 | Component: | range |
Version: | Boost 1.44.0 | Severity: | Cosmetic |
Keywords: | range concept | Cc: |
Description
Hi, I found some bugs in <boost/range/concepts.hpp>.
--- concepts.hpp.orig 2010-06-14 16:33:32.700239204 +0800 +++ concepts.hpp 2010-06-17 07:05:44.209528094 +0800 @@ -295,8 +295,8 @@
struct BidirectionalRangeConcept : ForwardRangeConcept<T> {
#if BOOST_RANGE_ENABLE_CONCEPT_ASSERT
- BOOST_RANGE_CONCEPT_ASSERT((BidirectionalIteratorConcept<BOOST_DEDUCED_TYPENAME BidirectionalRangeConcept::iterator>));
- BOOST_RANGE_CONCEPT_ASSERT((BidirectionalIteratorConcept<BOOST_DEDUCED_TYPENAME BidirectionalRangeConcept::const_iterator>));
+ BOOST_RANGE_CONCEPT_ASSERT((range_detail::BidirectionalIteratorConcept<BOOST_DEDUCED_TYPENAME BidirectionalRangeConcept::iterator>)); + BOOST_RANGE_CONCEPT_ASSERT((range_detail::BidirectionalIteratorConcept<BOOST_DEDUCED_TYPENAME BidirectionalRangeConcept::const_iterator>));
#endif
};
@@ -313,8 +313,8 @@
struct RandomAccessRangeConcept : BidirectionalRangeConcept<T> {
#if BOOST_RANGE_ENABLE_CONCEPT_ASSERT
- BOOST_RANGE_CONCEPT_ASSERT((RandomAccessIteratorConcept<BOOST_DEDUCED_TYPENAME RandomAccessRangeConcept::iterator>));
- BOOST_RANGE_CONCEPT_ASSERT((RandomAccessIteratorConcept<BOOST_DEDUCED_TYPENAME RandomAccessRangeConcept::const_iterator>));
+ BOOST_RANGE_CONCEPT_ASSERT((range_detail::RandomAccessIteratorConcept<BOOST_DEDUCED_TYPENAME RandomAccessRangeConcept::iterator>)); + BOOST_RANGE_CONCEPT_ASSERT((range_detail::RandomAccessIteratorConcept<BOOST_DEDUCED_TYPENAME RandomAccessRangeConcept::const_iterator>));
#endif
};
Attachments (2)
Change History (11)
by , 12 years ago
Attachment: | concepts.hpp.diff added |
---|
follow-up: 2 comment:1 by , 12 years ago
Severity: | Problem → Cosmetic |
---|
The code works correctly without this patch, because Boost.ConceptCheck includes these concepts in the boost namespace. What I'd like to know is why range defines its own versions of the iterator concepts, instead of using the ones from Boost.ConceptCheck?
comment:2 by , 12 years ago
Replying to steven_watanabe:
The code works correctly without this patch, because Boost.ConceptCheck includes these concepts in the boost namespace. What I'd like to know is why range defines its own versions of the iterator concepts, instead of using the ones from Boost.ConceptCheck?
In Boost.ConceptCheck are 'BidirectionalIterator' and 'RandomAccessIterator', I can't find 'BidirectionalIteratorConcept' and 'RandomAccessIteratorConcept'.
follow-up: 4 comment:3 by , 12 years ago
If you trace through the macros, you'll find that they define versions both with and without the Concept suffix.
comment:4 by , 12 years ago
Replying to steven_watanabe:
If you trace through the macros, you'll find that they define versions both with and without the Concept suffix.
I attach 'test.cpp', maybe you can test it :)
follow-up: 6 comment:5 by , 12 years ago
with the trunk I get
C:\boost\trunk\boost/concept_check.hpp(516) : error C2100: illegal indirection C:\boost\trunk\boost/concept_check.hpp(510) : while compiling class template member function 'boost::ForwardIterator<TT>::~ForwardIterator(void)' with [ TT=Iterator<ValueType> ]
which is the expected result, as there's no operator*.
comment:6 by , 12 years ago
Replying to steven_watanabe:
with the trunk I get
C:\boost\trunk\boost/concept_check.hpp(516) : error C2100: illegal indirection C:\boost\trunk\boost/concept_check.hpp(510) : while compiling class template member function 'boost::ForwardIterator<TT>::~ForwardIterator(void)' with [ TT=Iterator<ValueType> ]which is the expected result, as there's no operator*.
BidirectionalIteratorConcept check concept with ForwardIteratorConcept, DefaultConstructiable, SignlePassIterator, IncrementableIteratorConcept, EqualityComparable and CopyConstructiable, they are not to check operator*. But if I add 'detail_range::' in concepts.hpp at line 298, 299, the compiler can complete this code.
comment:7 by , 12 years ago
Oh. I see that range_detail::ForwardIteratorConcept doesn't check for operator*. This is a bug. operator* is required for ForwardIterators. test.cpp should not compile.
comment:8 by , 12 years ago
Status: | new → assigned |
---|
comment:9 by , 12 years ago
Milestone: | Boost 1.43.0 → Boost 1.46.0 |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
Resolved on the trunk.
without namespace 'range_detail'