]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/circular_buffer/example/circular_buffer_iter_example.cpp
1 // Copyright 2003-2008 Jan Gaspar.
2 // Copyright 2013 Paul A. Bristow. Added some Quickbook snippet markers.
4 // Distributed under the Boost Software License, Version 1.0.
5 // (See the accompanying file LICENSE_1_0.txt
6 // or a copy at <http://www.boost.org/LICENSE_1_0.txt>.)
8 #undef BOOST_CB_ENABLE_DEBUG
10 //[circular_buffer_iter_example_1
14 #define BOOST_CB_ENABLE_DEBUG 0 // The Debug Support has to be disabled, otherwise the code produces a runtime error.
16 #include <boost/circular_buffer.hpp>
17 #include <boost/assert.hpp>
20 int main(int /*argc*/, char* /*argv*/[])
23 boost::circular_buffer
<int> cb(3);
29 boost::circular_buffer
<int>::iterator it
= cb
.begin();
35 assert(*it
== 4); // The iterator still points to the initialized memory.
40 //] [/circular_buffer_iter_example_1]