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 BOOST_BIMAP_CONTAINER_ADAPTOR_DETAIL_KEY_EXTRACTOR_HPP
14
15#if defined(_MSC_VER)
16#pragma once
17#endif
18
19#include <boost/config.hpp>
20
21namespace boost {
22namespace bimaps {
23namespace container_adaptor {
24namespace detail {
25
26/// \brief Key Extractor
27
28template < class T >
29struct key_from_pair_extractor
30{
31 typedef T argument_type;
32 typedef BOOST_DEDUCED_TYPENAME T::first_type result_type;
33
34 result_type operator()( 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

source code of boost/libs/bimap/include/boost/bimap/container_adaptor/detail/key_extractor.hpp