1 #ifndef BOOST_MP11_DETAIL_MP_MAP_FIND_HPP_INCLUDED
2 #define BOOST_MP11_DETAIL_MP_MAP_FIND_HPP_INCLUDED
4 // Copyright 2015 Peter Dimov.
6 // Distributed under the Boost Software License, Version 1.0.
8 // See accompanying file LICENSE_1_0.txt or copy at
9 // http://www.boost.org/LICENSE_1_0.txt
11 #include <boost/mp11/utility.hpp>
22 template<class M, class K> struct mp_map_find_impl;
24 template<template<class...> class M, class... T, class K> struct mp_map_find_impl<M<T...>, K>
26 using U = mp_inherit<mp_identity<T>...>;
28 template<template<class...> class L, class... U> static mp_identity<L<K, U...>> f( mp_identity<L<K, U...>>* );
29 static mp_identity<void> f( ... );
31 using V = decltype( f((U*)0) );
33 using type = typename V::type;
38 template<class M, class K> using mp_map_find = typename detail::mp_map_find_impl<M, K>::type;
43 #endif // #ifndef BOOST_MP11_DETAIL_MP_MAP_FIND_HPP_INCLUDED