CodeMover prototype
[dyninst.git] / external / boost / circular_buffer.hpp
1 // Circular buffer library header file.\r
2 \r
3 // Copyright (c) 2003-2008 Jan Gaspar\r
4 \r
5 // Use, modification, and distribution is subject to the Boost Software\r
6 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at\r
7 // http://www.boost.org/LICENSE_1_0.txt)\r
8 \r
9 //  See www.boost.org/libs/circular_buffer for documentation.\r
10 \r
11 #if !defined(BOOST_CIRCULAR_BUFFER_HPP)\r
12 #define BOOST_CIRCULAR_BUFFER_HPP\r
13 \r
14 #if defined(_MSC_VER) && _MSC_VER >= 1200\r
15     #pragma once\r
16 #endif\r
17 \r
18 #include <boost/circular_buffer_fwd.hpp>\r
19 #include <boost/detail/workaround.hpp>\r
20 \r
21 // BOOST_CB_ENABLE_DEBUG: Debug support control.\r
22 #if defined(NDEBUG) || defined(BOOST_CB_DISABLE_DEBUG)\r
23     #define BOOST_CB_ENABLE_DEBUG 0\r
24 #else\r
25     #define BOOST_CB_ENABLE_DEBUG 1\r
26 #endif\r
27 \r
28 // BOOST_CB_ASSERT: Runtime assertion.\r
29 #if BOOST_CB_ENABLE_DEBUG\r
30     #include <boost/assert.hpp>\r
31     #define BOOST_CB_ASSERT(Expr) BOOST_ASSERT(Expr)\r
32 #else\r
33     #define BOOST_CB_ASSERT(Expr) ((void)0)\r
34 #endif\r
35 \r
36 // BOOST_CB_STATIC_ASSERT: Compile time assertion.\r
37 #if BOOST_WORKAROUND(BOOST_MSVC, < 1300)\r
38     #define BOOST_CB_STATIC_ASSERT(Expr) ((void)0)\r
39 #else\r
40     #include <boost/static_assert.hpp>\r
41     #define BOOST_CB_STATIC_ASSERT(Expr) BOOST_STATIC_ASSERT(Expr)\r
42 #endif\r
43 \r
44 // BOOST_CB_IS_CONVERTIBLE: Check if Iterator::value_type is convertible to Type.\r
45 #if BOOST_WORKAROUND(__BORLANDC__, <= 0x0550) || BOOST_WORKAROUND(__MWERKS__, <= 0x2407) || \\r
46     BOOST_WORKAROUND(BOOST_MSVC, < 1300)\r
47     #define BOOST_CB_IS_CONVERTIBLE(Iterator, Type) ((void)0)\r
48 #else\r
49     #include <boost/detail/iterator.hpp>\r
50     #include <boost/type_traits/is_convertible.hpp>\r
51     #define BOOST_CB_IS_CONVERTIBLE(Iterator, Type) \\r
52         BOOST_CB_STATIC_ASSERT((is_convertible<typename detail::iterator_traits<Iterator>::value_type, Type>::value))\r
53 #endif\r
54 \r
55 // BOOST_CB_ASSERT_TEMPLATED_ITERATOR_CONSTRUCTORS:\r
56 // Check if the STL provides templated iterator constructors for its containers.\r
57 #if defined(BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS)\r
58     #define BOOST_CB_ASSERT_TEMPLATED_ITERATOR_CONSTRUCTORS BOOST_CB_STATIC_ASSERT(false);\r
59 #else\r
60     #define BOOST_CB_ASSERT_TEMPLATED_ITERATOR_CONSTRUCTORS ((void)0);\r
61 #endif\r
62 \r
63 #include <boost/circular_buffer/debug.hpp>\r
64 #include <boost/circular_buffer/details.hpp>\r
65 #include <boost/circular_buffer/base.hpp>\r
66 #include <boost/circular_buffer/space_optimized.hpp>\r
67 \r
68 #undef BOOST_CB_ASSERT_TEMPLATED_ITERATOR_CONSTRUCTORS\r
69 #undef BOOST_CB_IS_CONVERTIBLE\r
70 #undef BOOST_CB_STATIC_ASSERT\r
71 #undef BOOST_CB_ASSERT\r
72 #undef BOOST_CB_ENABLE_DEBUG\r
73 \r
74 #endif // #if !defined(BOOST_CIRCULAR_BUFFER_HPP)\r