3 // Copyright (c) 2006-2007 Matias Capeletto
5 // Distributed under the Boost Software License, Version 1.0.
6 // (See accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt)
9 /// \file container_adaptor/detail/key_extractor.hpp
10 /// \brief Key extractor for a pair<Key,Data>.
12 #ifndef BOOST_BIMAP_CONTAINER_ADAPTOR_DETAIL_KEY_EXTRACTOR_HPP
13 #define BOOST_BIMAP_CONTAINER_ADAPTOR_DETAIL_KEY_EXTRACTOR_HPP
15 #if defined(_MSC_VER) && (_MSC_VER>=1200)
19 #include <boost/config.hpp>
25 namespace container_adaptor {
28 /// \brief Key Extractor
31 struct key_from_pair_extractor
32 : std::unary_function< T, BOOST_DEDUCED_TYPENAME T::first_type >
34 bool operator()( const T & p ) { return p.first; }
38 } // namespace container_adaptor
43 #endif // BOOST_BIMAP_CONTAINER_ADAPTOR_DETAIL_KEY_EXTRACTOR_HPP