Chris@101: /* Copyright 2003-2013 Joaquin M Lopez Munoz. Chris@16: * Distributed under the Boost Software License, Version 1.0. Chris@16: * (See accompanying file LICENSE_1_0.txt or copy at Chris@16: * http://www.boost.org/LICENSE_1_0.txt) Chris@16: * Chris@16: * See http://www.boost.org/libs/multi_index for library home page. Chris@16: */ Chris@16: Chris@16: #ifndef BOOST_MULTI_INDEX_DETAIL_UNBOUNDED_HPP Chris@16: #define BOOST_MULTI_INDEX_DETAIL_UNBOUNDED_HPP Chris@16: Chris@101: #if defined(_MSC_VER) Chris@16: #pragma once Chris@16: #endif Chris@16: Chris@16: #include /* keep it first to prevent nasty warns in MSVC */ Chris@16: #include Chris@16: Chris@16: namespace boost{ Chris@16: Chris@16: namespace multi_index{ Chris@16: Chris@16: /* dummy type and variable for use in ordered_index::range() */ Chris@16: Chris@16: /* ODR-abiding technique shown at the example attached to Chris@16: * http://lists.boost.org/Archives/boost/2006/07/108355.php Chris@16: */ Chris@16: Chris@16: namespace detail{class unbounded_helper;} Chris@16: Chris@16: detail::unbounded_helper unbounded(detail::unbounded_helper); Chris@16: Chris@16: namespace detail{ Chris@16: Chris@16: class unbounded_helper Chris@16: { Chris@16: unbounded_helper(){} Chris@16: unbounded_helper(const unbounded_helper&){} Chris@16: friend unbounded_helper multi_index::unbounded(unbounded_helper); Chris@16: }; Chris@16: Chris@16: typedef unbounded_helper (*unbounded_type)(unbounded_helper); Chris@16: Chris@16: } /* namespace multi_index::detail */ Chris@16: Chris@16: inline detail::unbounded_helper unbounded(detail::unbounded_helper) Chris@16: { Chris@16: return detail::unbounded_helper(); Chris@16: } Chris@16: Chris@16: /* tags used in the implementation of range */ Chris@16: Chris@16: namespace detail{ Chris@16: Chris@16: struct none_unbounded_tag{}; Chris@16: struct lower_unbounded_tag{}; Chris@16: struct upper_unbounded_tag{}; Chris@16: struct both_unbounded_tag{}; Chris@16: Chris@16: } /* namespace multi_index::detail */ Chris@16: Chris@16: } /* namespace multi_index */ Chris@16: Chris@16: } /* namespace boost */ Chris@16: Chris@16: #endif