annotate DEPENDENCIES/generic/include/boost/variant/detail/element_index.hpp @ 125:34e428693f5d vext

Vext -> Repoint
author Chris Cannam
date Thu, 14 Jun 2018 11:15:39 +0100
parents f46d142149f5
children
rev   line source
Chris@102 1 //-----------------------------------------------------------------------------
Chris@102 2 // boost variant/detail/element_index.hpp header file
Chris@102 3 // See http://www.boost.org for updates, documentation, and revision history.
Chris@102 4 //-----------------------------------------------------------------------------
Chris@102 5 //
Chris@102 6 // Copyright (c) 2014-2015 Antony Polukhin
Chris@102 7 //
Chris@102 8 // Distributed under the Boost Software License, Version 1.0. (See
Chris@102 9 // accompanying file LICENSE_1_0.txt or copy at
Chris@102 10 // http://www.boost.org/LICENSE_1_0.txt)
Chris@102 11
Chris@102 12 #ifndef BOOST_VARIANT_DETAIL_ELEMENT_INDEX_HPP
Chris@102 13 #define BOOST_VARIANT_DETAIL_ELEMENT_INDEX_HPP
Chris@102 14
Chris@102 15 #include "boost/config.hpp"
Chris@102 16 #include "boost/variant/recursive_wrapper_fwd.hpp"
Chris@102 17 #include "boost/variant/variant_fwd.hpp"
Chris@102 18
Chris@102 19 #include "boost/mpl/find_if.hpp"
Chris@102 20
Chris@102 21 namespace boost { namespace detail { namespace variant {
Chris@102 22
Chris@102 23 template <class VariantElement, class T>
Chris@102 24 struct variant_element_functor :
Chris@102 25 boost::mpl::or_<
Chris@102 26 boost::is_same<VariantElement, T>,
Chris@102 27 boost::is_same<VariantElement, boost::recursive_wrapper<T> >,
Chris@102 28 boost::is_same<VariantElement, T& >
Chris@102 29 >
Chris@102 30 {};
Chris@102 31
Chris@102 32 template <class Types, class T>
Chris@102 33 struct element_iterator_impl :
Chris@102 34 boost::mpl::find_if<
Chris@102 35 Types,
Chris@102 36 boost::mpl::or_<
Chris@102 37 variant_element_functor<boost::mpl::_1, T>,
Chris@102 38 variant_element_functor<boost::mpl::_1, typename boost::remove_cv<T>::type >
Chris@102 39 >
Chris@102 40 >
Chris@102 41 {};
Chris@102 42
Chris@102 43 template <class Variant, class T>
Chris@102 44 struct element_iterator :
Chris@102 45 element_iterator_impl< typename Variant::types, T>
Chris@102 46 {};
Chris@102 47
Chris@102 48 template <class Variant, class T>
Chris@102 49 struct holds_element :
Chris@102 50 boost::mpl::not_<
Chris@102 51 boost::is_same<
Chris@102 52 typename boost::mpl::end<typename Variant::types>::type,
Chris@102 53 typename element_iterator<Variant, T>::type
Chris@102 54 >
Chris@102 55 >
Chris@102 56 {};
Chris@102 57
Chris@102 58
Chris@102 59 }}} // namespace boost::detail::variant
Chris@102 60
Chris@102 61 #endif // BOOST_VARIANT_DETAIL_ELEMENT_INDEX_HPP