| 1 | // Boost.Bimap |
| 2 | // |
| 3 | // Copyright (c) 2006-2007 Matias Capeletto |
| 4 | // |
| 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) |
| 8 | |
| 9 | /// \file container_adaptor/detail/key_extractor.hpp |
| 10 | /// \brief Key extractor for a pair<Key,Data>. |
| 11 | |
| 12 | #ifndef BOOST_BIMAP_CONTAINER_ADAPTOR_DETAIL_KEY_EXTRACTOR_HPP |
| 13 | #define |
| 14 | |
| 15 | #if defined(_MSC_VER) |
| 16 | #pragma once |
| 17 | #endif |
| 18 | |
| 19 | #include <boost/config.hpp> |
| 20 | |
| 21 | namespace boost { |
| 22 | namespace bimaps { |
| 23 | namespace container_adaptor { |
| 24 | namespace detail { |
| 25 | |
| 26 | /// \brief Key Extractor |
| 27 | |
| 28 | template < class T > |
| 29 | struct |
| 30 | { |
| 31 | typedef T ; |
| 32 | typedef BOOST_DEDUCED_TYPENAME T::first_type ; |
| 33 | |
| 34 | result_type ( const T & p ) { return p.first; } |
| 35 | }; |
| 36 | |
| 37 | } // namespace detail |
| 38 | } // namespace container_adaptor |
| 39 | } // namespace bimaps |
| 40 | } // namespace boost |
| 41 | |
| 42 | |
| 43 | #endif // BOOST_BIMAP_CONTAINER_ADAPTOR_DETAIL_KEY_EXTRACTOR_HPP |
| 44 | |
| 45 | |
| 46 | |