diff --git a/doc/TODO b/doc/TODO index 5620d2f..c414b39 100644 --- a/doc/TODO +++ b/doc/TODO @@ -33,6 +33,8 @@ t09 DONE t10 docs: define exception safety for every method "Guarantee of basic exception safety" as a design criteria for the whole container should be removed or amended. + Plus add some 'generic_test's if the method does't guarantee only a basic + exception safety. t11 DONE docs: remove/amend "In fact the circular_buffer is defined in the file @@ -147,21 +149,22 @@ t44 DONE add some "post tests" after testing non-const methods (such as inserting an element into container which is tested for erase) -t55 DONE - no action needed +t45 DONE - no action needed check the iterator's operator []; add assertion if needed -t56 rename files e.g. from adaptor to space_optimized_adaptor +t46 rename files e.g. from adaptor to space_optimized_adaptor -t57 constructor and insert methods taking input iterator does not work with +t47 constructor and insert methods taking input iterator does not work with istream_iterator - std::distance() function does't work as expected - fix needed -t58 verify the correctness of the SGIAssignableConcept +t48 DONE + verify the correctness of the SGIAssignableConcept -t59 test insert and rinsert methods if the original and returned iterators - meet the postconditions +t49 test non-invalidation of the iterators after call to methods such as insert + or rinsert -t60 add assign methods with capacity parameter +t50 add assign methods with capacity parameter ------------------------------------------------------------------------------- diff --git a/include/boost/circular_buffer/adaptor.hpp b/include/boost/circular_buffer/adaptor.hpp index c3b8a63..1a12feb 100644 --- a/include/boost/circular_buffer/adaptor.hpp +++ b/include/boost/circular_buffer/adaptor.hpp @@ -46,8 +46,8 @@ public: typedef typename circular_buffer::iterator iterator; typedef typename circular_buffer::const_reverse_iterator const_reverse_iterator; typedef typename circular_buffer::reverse_iterator reverse_iterator; - typedef typename circular_buffer::range range; - typedef typename circular_buffer::const_range const_range; + typedef typename circular_buffer::array_range array_range; + typedef typename circular_buffer::const_array_range const_array_range; typedef typename circular_buffer::param_value_type param_value_type; typedef typename circular_buffer::return_value_type return_value_type; diff --git a/include/boost/circular_buffer/base.hpp b/include/boost/circular_buffer/base.hpp index b7cd66b..b6cc779 100644 --- a/include/boost/circular_buffer/base.hpp +++ b/include/boost/circular_buffer/base.hpp @@ -98,11 +98,11 @@ public: // Container specific types - // TODO - typedef std::pair range; + //! An array range. + typedef std::pair array_range; - // TODO - typedef std::pair const_range; + //! A range of a const array. + typedef std::pair const_array_range; // Helper types @@ -253,23 +253,23 @@ public: } // TODO - range array_one() { - return range(m_first, (m_last <= m_first && !empty() ? m_end : m_last) - m_first); + array_range array_one() { + return array_range(m_first, (m_last <= m_first && !empty() ? m_end : m_last) - m_first); } // TODO - range array_two() { - return range(m_buff, m_last <= m_first && !empty() ? m_last - m_buff : 0); + array_range array_two() { + return array_range(m_buff, m_last <= m_first && !empty() ? m_last - m_buff : 0); } // TODO - const_range array_one() const { - return const_range(m_first, (m_last <= m_first && !empty() ? m_end : m_last) - m_first); + const_array_range array_one() const { + return const_array_range(m_first, (m_last <= m_first && !empty() ? m_end : m_last) - m_first); } // TODO - const_range array_two() const { - return const_range(m_buff, m_last <= m_first && !empty() ? m_last - m_buff : 0); + const_array_range array_two() const { + return const_array_range(m_buff, m_last <= m_first && !empty() ? m_last - m_buff : 0); } //! TODO Return pointer to data stored in the circular buffer as a continuous array of values. diff --git a/test/common.cpp b/test/common.cpp index d708dac..94a9d6d 100644 --- a/test/common.cpp +++ b/test/common.cpp @@ -247,8 +247,8 @@ void front_and_back_test() { void array_test() { // TODO CB_CONTAINER cb(1); - CB_CONTAINER::range a1 = cb.array_one(); - CB_CONTAINER::range a2 = cb.array_two(); + CB_CONTAINER::array_range a1 = cb.array_one(); + CB_CONTAINER::const_array_range a2 = cb.array_two(); BOOST_CHECK(a1.second == 0); BOOST_CHECK(a2.second == 0);