1 /* Copyright 2003-2013 Joaquin M Lopez Munoz.
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_UNBOUNDED_HPP
10 #define BOOST_MULTI_INDEX_DETAIL_UNBOUNDED_HPP
16 #include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
17 #include <boost/detail/workaround.hpp>
21 namespace multi_index{
23 /* dummy type and variable for use in ordered_index::range() */
25 /* ODR-abiding technique shown at the example attached to
26 * http://lists.boost.org/Archives/boost/2006/07/108355.php
29 namespace detail{class unbounded_helper;}
31 detail::unbounded_helper unbounded(detail::unbounded_helper);
35 class unbounded_helper
38 unbounded_helper(const unbounded_helper&){}
39 friend unbounded_helper multi_index::unbounded(unbounded_helper);
42 typedef unbounded_helper (*unbounded_type)(unbounded_helper);
44 } /* namespace multi_index::detail */
46 inline detail::unbounded_helper unbounded(detail::unbounded_helper)
48 return detail::unbounded_helper();
51 /* tags used in the implementation of range */
55 struct none_unbounded_tag{};
56 struct lower_unbounded_tag{};
57 struct upper_unbounded_tag{};
58 struct both_unbounded_tag{};
60 } /* namespace multi_index::detail */
62 } /* namespace multi_index */
64 } /* namespace boost */