circular_buffer.hpp 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. // Circular buffer library header file.
  2. // Copyright (c) 2003-2008 Jan Gaspar
  3. // Use, modification, and distribution is subject to the Boost Software
  4. // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  5. // http://www.boost.org/LICENSE_1_0.txt)
  6. // See www.boost.org/libs/circular_buffer for documentation.
  7. /*! @file
  8. Includes <boost/circular_buffer/base.hpp>
  9. */
  10. #if !defined(BOOST_CIRCULAR_BUFFER_HPP)
  11. #define BOOST_CIRCULAR_BUFFER_HPP
  12. #if defined(_MSC_VER)
  13. #pragma once
  14. #endif
  15. #include <boost/circular_buffer_fwd.hpp>
  16. #include <boost/config/workaround.hpp>
  17. #include <boost/static_assert.hpp>
  18. /*! Debug support control. */
  19. #if !defined(BOOST_CB_ENABLE_DEBUG)
  20. #define BOOST_CB_ENABLE_DEBUG 0
  21. #endif
  22. /*! INTERNAL ONLY */
  23. #if BOOST_CB_ENABLE_DEBUG
  24. #include <boost/assert.hpp>
  25. #define BOOST_CB_ASSERT(Expr) BOOST_ASSERT(Expr)
  26. #else
  27. #define BOOST_CB_ASSERT(Expr) ((void)0)
  28. #endif
  29. /*! INTERNAL ONLY */
  30. #if BOOST_WORKAROUND(BOOST_BORLANDC, <= 0x0550) || BOOST_WORKAROUND(__MWERKS__, <= 0x2407)
  31. #define BOOST_CB_IS_CONVERTIBLE(Iterator, Type) ((void)0)
  32. #else
  33. #include <iterator>
  34. #include <boost/type_traits/is_convertible.hpp>
  35. #define BOOST_CB_IS_CONVERTIBLE(Iterator, Type) \
  36. BOOST_STATIC_ASSERT((is_convertible<typename std::iterator_traits<Iterator>::value_type, Type>::value))
  37. #endif
  38. /*! INTERNAL ONLY */
  39. #if defined(BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS)
  40. #define BOOST_CB_ASSERT_TEMPLATED_ITERATOR_CONSTRUCTORS BOOST_STATIC_ASSERT(false);
  41. #else
  42. #define BOOST_CB_ASSERT_TEMPLATED_ITERATOR_CONSTRUCTORS ((void)0);
  43. #endif
  44. #include <boost/circular_buffer/debug.hpp>
  45. #include <boost/circular_buffer/details.hpp>
  46. #include <boost/circular_buffer/base.hpp>
  47. #include <boost/circular_buffer/space_optimized.hpp>
  48. #undef BOOST_CB_ASSERT_TEMPLATED_ITERATOR_CONSTRUCTORS
  49. #undef BOOST_CB_IS_CONVERTIBLE
  50. #undef BOOST_CB_ASSERT
  51. #endif // #if !defined(BOOST_CIRCULAR_BUFFER_HPP)