Boost logo

Boost :

From: Pavel Vozenilek (pavel_vozenilek_at_[hidden])
Date: 2004-03-12 17:36:28

Bellow are few notes to circular_buffer library.
Over weekend I'll reread the code and post remaining notes.

1. docs: there should be warning for
   data() documentation that the returned
   pointer gets very easily invalidated.
2. docs: Synopsis in circular_buffer.html
   could be splitted by <p> into two paragraphs.
   It would look less "heavy".
3. the macros as BOOST_CB_TRY should be at some time
replaced by common Boost macros.

These macros are proposed but not yet added there AFAIK.

#if !(defined BOOST_NO_EXCEPTIONS)
# define BOOST_TRY { try
# define BOOST_CATCH(x) catch(x)
# define BOOST_RETHROW throw
# define BOOST_CATCH_END }
# define BOOST_TRY { if ("")
# define BOOST_CATCH(x) else if (!"")
# else
# define BOOST_TRY { if (true)
# define BOOST_CATCH else if (false)
# endif
# define BOOST_CATCH_END }
4. circular_buffer.hpp:

#include <boost/type_traits.hpp>
should be replaced by finer granularity includes.
This line big huge impact on compilation time.
5. base.hpp:

    #include <string.h>

maybe this can change to <cstring>.
6. base.hpp, Intel C++ 7.0, warning on line:

    void replace(pointer pos, param_value_type item) {
        replace(pos, item, cb_details::template
cb_replace_category_traits<value_type>::tag()); <<< here

pp(1105): warning #1017: name following "template"
must be a member template

Dtto assign(), insert(), rinsert(). insert()/rinsert() in adaptor.hpp.
7. base.hpp: few places contain text "circular_buffer<T, Alloc>".

Helper type, e.g. self_t can be created and used
there. Its slightly easier to read.

Boost list run by bdawes at, gregod at, cpdaniel at, john at