Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
1 /* Copyright 2003-2006 Joaquín M López Muñoz.
2 * Distributed under the Boost Software License, Version 1.0.
3 * (See accompanying file LICENSE_1_0.txt or copy at
4 * http://www.boost.org/LICENSE_1_0.txt)
6 * See http://www.boost.org/libs/multi_index for library home page.
9 #ifndef BOOST_MULTI_INDEX_DETAIL_SAFE_CTR_PROXY_HPP
10 #define BOOST_MULTI_INDEX_DETAIL_SAFE_CTR_PROXY_HPP
12 #if defined(_MSC_VER)&&(_MSC_VER>=1200)
16 #if defined(BOOST_MULTI_INDEX_ENABLE_SAFE_MODE)
17 #include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
18 #include <boost/detail/workaround.hpp>
20 #if BOOST_WORKAROUND(BOOST_MSVC,<1300)
21 #include <boost/multi_index/detail/safe_mode.hpp>
25 namespace multi_index{
29 /* A safe iterator is instantiated in the form
30 * safe_iterator<Iterator,Container>: MSVC++ 6.0 has serious troubles with
31 * the resulting symbols names, given that index names (which stand for
32 * Container) are fairly long themselves. safe_ctr_proxy does not statically
33 * depend on Container, and provides the necessary methods (begin and end) to
34 * the safe mode framework via an abstract interface. With safe_ctr_proxy,
35 * instead of deriving from safe_container<Container> the following base class
38 * safe_ctr_proxy_impl<Iterator,Container>
40 * where Iterator is the type of the *unsafe* iterator being wrapped.
41 * The corresponding safe iterator instantiation is then
43 * safe_iterator<Iterator,safe_ctr_proxy<Iterator> >,
45 * which does not include the name of Container.
48 template<typename Iterator>
50 public safe_mode::safe_container<safe_ctr_proxy<Iterator> >
53 typedef safe_mode::safe_iterator<Iterator,safe_ctr_proxy> iterator;
54 typedef iterator const_iterator;
56 iterator begin(){return begin_impl();}
57 const_iterator begin()const{return begin_impl();}
58 iterator end(){return end_impl();}
59 const_iterator end()const{return end_impl();}
62 virtual iterator begin_impl()=0;
63 virtual const_iterator begin_impl()const=0;
64 virtual iterator end_impl()=0;
65 virtual const_iterator end_impl()const=0;
68 template<typename Iterator,typename Container>
69 class safe_ctr_proxy_impl:public safe_ctr_proxy<Iterator>
71 typedef safe_ctr_proxy<Iterator> super;
72 typedef Container container_type;
75 typedef typename super::iterator iterator;
76 typedef typename super::const_iterator const_iterator;
78 virtual iterator begin_impl(){return container().begin();}
79 virtual const_iterator begin_impl()const{return container().begin();}
80 virtual iterator end_impl(){return container().end();}
81 virtual const_iterator end_impl()const{return container().end();}
84 container_type& container()
86 return *static_cast<container_type*>(this);
89 const container_type& container()const
91 return *static_cast<const container_type*>(this);
95 } /* namespace multi_index::detail */
97 } /* namespace multi_index */
99 } /* namespace boost */
101 #endif /* workaround */
103 #endif /* BOOST_MULTI_INDEX_ENABLE_SAFE_MODE */