Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-11-15 09:03:59

0001 // Boost.Bimap
0002 //
0003 // Copyright (c) 2006-2007 Matias Capeletto
0004 //
0005 // Distributed under the Boost Software License, Version 1.0.
0006 // (See accompanying file LICENSE_1_0.txt or copy at
0007 // http://www.boost.org/LICENSE_1_0.txt)
0008 
0009 /// \file detail/non_unique_views_helper.hpp
0010 /// \brief Details for non unique views
0011 
0012 #ifndef BOOST_BIMAP_DETAIL_NON_UNIQUE_VIEWS_HELPER_HPP
0013 #define BOOST_BIMAP_DETAIL_NON_UNIQUE_VIEWS_HELPER_HPP
0014 
0015 #if defined(_MSC_VER)
0016 #pragma once
0017 #endif
0018 
0019 #include <boost/config.hpp>
0020 
0021 /*===========================================================================*/
0022 #define BOOST_BIMAP_NON_UNIQUE_VIEW_INSERT_FUNCTIONS                         \
0023                                                                              \
0024 template <class InputIterator>                                               \
0025 void insert(InputIterator iterBegin, InputIterator iterEnd)                  \
0026 {                                                                            \
0027     for( ; iterBegin != iterEnd ; ++iterBegin )                              \
0028     {                                                                        \
0029         this->base().insert(                                                 \
0030             this->template functor<                                          \
0031                 BOOST_DEDUCED_TYPENAME base_::value_to_base>()(              \
0032                     BOOST_DEDUCED_TYPENAME base_::value_type(*iterBegin)) ); \
0033     }                                                                        \
0034 }                                                                            \
0035                                                                              \
0036 std::pair<BOOST_DEDUCED_TYPENAME base_::iterator, bool> insert(              \
0037     BOOST_DEDUCED_TYPENAME ::boost::call_traits<                             \
0038         BOOST_DEDUCED_TYPENAME base_::value_type >::param_type x)            \
0039 {                                                                            \
0040     typedef BOOST_DEDUCED_TYPENAME base_::base_type::iterator base_iterator; \
0041                                                                              \
0042     std::pair< base_iterator, bool > r(                                      \
0043         this->base().insert(                                                 \
0044             this->template functor<                                          \
0045                 BOOST_DEDUCED_TYPENAME base_::value_to_base>()(x) )          \
0046     );                                                                       \
0047                                                                              \
0048     return std::pair<typename base_::iterator, bool>(                        \
0049         this->template functor<                                              \
0050             BOOST_DEDUCED_TYPENAME base_::iterator_from_base>()(r.first),    \
0051             r.second                                                         \
0052     );                                                                       \
0053 }                                                                            \
0054                                                                              \
0055 BOOST_DEDUCED_TYPENAME base_::iterator insert(                               \
0056     BOOST_DEDUCED_TYPENAME base_::iterator pos,                              \
0057         BOOST_DEDUCED_TYPENAME ::boost::call_traits<                         \
0058             BOOST_DEDUCED_TYPENAME base_::value_type >::param_type x)        \
0059 {                                                                            \
0060     return this->template functor<                                           \
0061         BOOST_DEDUCED_TYPENAME base_::iterator_from_base>()(                 \
0062             this->base().insert(                                             \
0063                 this->template functor<                                      \
0064                     BOOST_DEDUCED_TYPENAME base_::iterator_to_base>()(pos),  \
0065             this->template functor<                                          \
0066                 BOOST_DEDUCED_TYPENAME base_::value_to_base>()(x))           \
0067     );                                                                       \
0068 }
0069 /*===========================================================================*/
0070 
0071 #endif // BOOST_BIMAP_DETAIL_NON_UNIQUE_VIEWS_HELPER_HPP