Boost C++ Libraries Boost.Bimap Home Libraries People FAQ More

PrevUpHomeNext

key_extractor.hpp

Go to the documentation of this file.
00001 // Boost.Bimap
00002 //
00003 // Copyright (c) 2006-2007 Matias Capeletto
00004 //
00005 // Distributed under the Boost Software License, Version 1.0.
00006 // (See accompanying file LICENSE_1_0.txt or copy at
00007 // http://www.boost.org/LICENSE_1_0.txt)
00008 
00009 /// \file container_adaptor/detail/key_extractor.hpp
00010 /// \brief Key extractor for a pair<Key,Data>.
00011 
00012 #ifndef BOOST_BIMAP_CONTAINER_ADAPTOR_DETAIL_KEY_EXTRACTOR_HPP
00013 #define BOOST_BIMAP_CONTAINER_ADAPTOR_DETAIL_KEY_EXTRACTOR_HPP
00014 
00015 #if defined(_MSC_VER) && (_MSC_VER>=1200)
00016 #pragma once
00017 #endif
00018 
00019 #include <boost/config.hpp>
00020 
00021 #include <functional>
00022 
00023 namespace boost {
00024 namespace bimaps {
00025 namespace container_adaptor {
00026 namespace detail {
00027 
00028 /// \brief Key Extractor
00029 
00030 template < class T >
00031 struct key_from_pair_extractor 
00032     : std::unary_function< T, BOOST_DEDUCED_TYPENAME T::first_type >
00033 {
00034     bool operator()( const T & p ) { return p.first; }
00035 };
00036 
00037 } // namespace detail
00038 } // namespace container_adaptor
00039 } // namespace bimaps
00040 } // namespace boost
00041 
00042 
00043 #endif // BOOST_BIMAP_CONTAINER_ADAPTOR_DETAIL_KEY_EXTRACTOR_HPP
00044 
00045 
Copyright 2006 Matias Capeletto

PrevUpHomeNext