]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/iterator/example/node_iterator1.cpp
1 // Copyright David Abrahams 2004. Use, modification and distribution is
2 // subject to the Boost Software License, Version 1.0. (See accompanying
3 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5 #include "node_iterator1.hpp"
15 #if defined(BOOST_NO_CXX11_SMART_PTR)
17 std::auto_ptr
<node
<int> > nodes(new node
<int>(42));
21 std::unique_ptr
<node
<int> > nodes(new node
<int>(42));
25 nodes
->append(new node
<std::string
>(" is greater than "));
26 nodes
->append(new node
<int>(13));
29 node_iterator(nodes
.get()), node_iterator()
30 , std::ostream_iterator
<node_base
>(std::cout
, " ")
32 std::cout
<< std::endl
;
35 node_iterator(nodes
.get()), node_iterator()
36 , std::mem_fun_ref(&node_base::double_me
)
40 node_iterator(nodes
.get()), node_iterator()
41 , std::ostream_iterator
<node_base
>(std::cout
, "/")
43 std::cout
<< std::endl
;