57#ifndef BIMAP_H_9B698EF9_C6E9_4BC4_A7D2_5B4D71155761
58#define BIMAP_H_9B698EF9_C6E9_4BC4_A7D2_5B4D71155761
59#define VERSION_BIMAP_9B698EF9_C6E9_4BC4_A7D2_5B4D71155761 0x00010003
62#pragma warning(disable:4786)
78#if defined(__GNUC__)&&(__GNUC__>3||(__GNUC__==3&&__GNUC_MINOR__>= 1))
79#define BIMAP_OFFSETOF_9B698EF9_C6E9_4BC4_A7D2_5B4D71155761(type,member) \
84 reinterpret_cast<size_t>( \
85 reinterpret_cast<const char*>( \
93#define BIMAP_OFFSETOF_9B698EF9_C6E9_4BC4_A7D2_5B4D71155761(type,member) offsetof(type,member)
101#if defined(_MSC_VER)&&_MSC_VER==1200
102#define BIMAP_REBIND_9B698EF9_C6E9_4BC4_A7D2_5B4D71155761(type1,type2) type1
104#define BIMAP_REBIND_9B698EF9_C6E9_4BC4_A7D2_5B4D71155761(type1,type2) \
105typename type1::template rebind<type2>::other
108template<
class Arg1,
class Arg2,
class Result>
116template <
typename ArgumentType,
typename ResultType>
166 template<
class then,
class els>
struct result
174 template<
class then,
class els>
struct result
190template<
bool test,
typename then,
typename els>
208#if defined(_MSC_VER)&&_MSC_VER>=1300
210#pragma warning(disable:4512)
214template<
typename first_type,
typename second_type>
217template<
typename first_type_,
typename second_type_>
229 template<
typename F,
typename S>
243template<
typename first_type,
typename second_type>
247 typedef std::pair<first_type,second_type> super;
251 direct_pair(
const first_type& first,
const second_type& second):super(first,second){}
253 template<
typename F,
typename S>
267#if defined(_MSC_VER)&&_MSC_VER>=1300
271template<
typename first_type,
typename second_type>
273 const first_type& first,
274 const second_type& second)
283template<
typename first_type,
typename second_type>
291template<
typename first_type,
typename second_type>
294 const std::pair<first_type,second_type>& y)
299template<
typename first_type,
typename second_type>
301 const std::pair<first_type,second_type>& x,
309template<
typename first_type,
typename second_type>
317template<
typename first_type,
typename second_type>
320 const std::pair<first_type,second_type>& y)
325template<
typename first_type,
typename second_type>
327 const std::pair<first_type,second_type>& x,
335template<
typename first_type,
typename second_type>
343template<
typename first_type,
typename second_type>
346 const std::pair<first_type,second_type>& y)
351template<
typename first_type,
typename second_type>
353 const std::pair<first_type,second_type>& x,
361template<
typename first_type,
typename second_type>
369template<
typename first_type,
typename second_type>
372 const std::pair<first_type,second_type>& y)
377template<
typename first_type,
typename second_type>
379 const std::pair<first_type,second_type>& x,
387template<
typename first_type,
typename second_type>
395template<
typename first_type,
typename second_type>
398 const std::pair<first_type,second_type>& y)
403template<
typename first_type,
typename second_type>
405 const std::pair<first_type,second_type>& x,
413template<
typename first_type,
typename second_type>
421template<
typename first_type,
typename second_type>
424 const std::pair<first_type,second_type>& y)
429template<
typename first_type,
typename second_type>
431 const std::pair<first_type,second_type>& x,
462 template<
typename bimap_type>
466 from_binding(bimap_type& bm,
const typename bimap_type::from_type& f):bm(bm),f(f){}
468 const typename bimap_type::to_type&
get()
const
470 typename bimap_type::from_set::const_iterator it=bm.fset.find(&f);
472 return bimap_type::element_by_from(*it)->second;
475 operator const typename bimap_type::to_type&()
const
486 typedef typename bimap_type::element bimap_element;
488 typename bimap_type::fset_iterator fit=bm.fset.find(&f);
489 typename bimap_type::tset_iterator tit=bm.tset.find(&t);
490 if(tit!=bm.tset.end()){
492 if(fit!=bm.fset.end()&&
493 bimap_type::element_by_from(*fit)==bimap_type::element_by_to(*tit)){
499 bimap_element * pne=0;
500 typename bimap_type::tset_iterator tnit=bm.tset.end();
502 pne=bm.new_element(bimap_element(f,t));
503 tnit=bm.tset.insert(&pne->second).first;
504 if(fit==bm.fset.end()){
505 bm.fset.insert(&pne->first);
509 bimap_element * pe=bimap_type::element_by_from(*fit);
510 bm.tset.erase(bm.tset.find(&pe->second));
511 bm.delete_element(pe);
512 const_cast<typename bimap_type::from_type *&
>(*fit)=
513 &
const_cast<typename bimap_type::from_type &
>(pne->first);
517 if(tnit!=bm.tset.end())bm.tset.erase(tnit);
518 if(pne)bm.delete_element(pne);
527 const typename bimap_type::from_type f;
530 template<
typename bimap_type>
538 const typename bimap_type::to_type&
get()
const
540 typename bimap_type::from_set::const_iterator it=bm.fset.find(&f);
542 return bimap_type::element_by_from(*it)->second;
545 operator const typename bimap_type::to_type&()
const
553 const bimap_type& bm;
554 const typename bimap_type::from_type f;
557 template<
typename bimap_type>
561 to_binding(bimap_type& bm,
const typename bimap_type::to_type& t):bm(bm),t(t){}
563 const typename bimap_type::from_type&
get()
const
565 typename bimap_type::to_set::const_iterator it=bm.tset.find(&t);
567 return bimap_type::element_by_to(*it)->first;
570 operator const typename bimap_type::from_type&()
const
581 typedef typename bimap_type::element bimap_element;
583 typename bimap_type::tset_iterator tit=bm.tset.find(&t);
584 typename bimap_type::fset_iterator fit=bm.fset.find(&f);
585 if(fit!=bm.fset.end()){
587 if(tit!=bm.tset.end()&&
588 bimap_type::element_by_to(*tit)==bimap_type::element_by_from(*fit)){
594 bimap_element * pne=0;
595 typename bimap_type::fset_iterator fnit=bm.fset.end();
597 pne=bm.new_element(bimap_element(f,t));
598 fnit=bm.fset.insert(&pne->first).first;
599 if(tit==bm.tset.end()){
600 bm.tset.insert(&pne->second);
604 bimap_element * pe=bimap_type::element_by_to(*tit);
605 bm.fset.erase(bm.fset.find(&pe->first));
606 bm.delete_element(pe);
607 const_cast<typename bimap_type::to_type *&
>(*tit)=
608 &
const_cast<typename bimap_type::to_type &
>(pne->second);
612 if(fnit!=bm.fset.end())bm.fset.erase(fnit);
613 if(pne)bm.delete_element(pne);
622 const typename bimap_type::to_type t;
625 template<
typename bimap_type>
633 const typename bimap_type::from_type&
get()
const
635 typename bimap_type::to_set::const_iterator it=bm.tset.find(&t);
637 return bimap_type::element_by_to(*it)->first;
640 operator const typename bimap_type::from_type&()
const
648 const bimap_type& bm;
649 const typename bimap_type::to_type t;
659 typename from_type_,
typename to_type_,
660 typename from_compare,
typename to_compare,
661 typename allocator_type_>
670 typedef from_type_ from_type;
671 typedef to_type_ to_type;
673 template<
typename type,
typename compare>
676 p_compare(
const compare& c=compare()):c(c){}
677 bool operator()(
const type* p1,
const type* p2)
const{
return c(*p1,*p2);}
678 compare get_compare()
const{
return c;}
697 typedef typename from_set::allocator_type fset_allocator_type;
698 typedef typename to_set::allocator_type tset_allocator_type;
699 typedef typename from_set::iterator fset_iterator;
700 typedef typename from_set::const_iterator const_fset_iterator;
701 typedef typename to_set::iterator tset_iterator;
702 typedef typename to_set::const_iterator const_tset_iterator;
705 const to_type> element;
706 allocator_type_ allocator;
716 element * new_element(
const element& e)
718 element * pe=allocator.allocate(1,0);
720 allocator.construct(pe,e);
722 allocator.destroy(pe);
728 void delete_element(element *pe)
730 allocator.destroy(pe);
731 allocator.deallocate(pe,1);
734 static element * element_by_from(
const from_type* pf)
737 reinterpret_cast<element*
>(
738 reinterpret_cast<char*
>(
739 const_cast<from_type *
>(pf))-
743 static element * element_by_to(
const to_type* pt)
746 reinterpret_cast<element *
>(
747 reinterpret_cast<char*
>(
748 const_cast<to_type *
>(pt))-
783 std::lexicographical_compare(
824 if(
kcomp(x.first,y.first))
return true;
825 if(
kcomp(y.first,x.first))
return false;
826 return tcomp(x.second,y.second);
844 class iterator:
public std::iterator<std::bidirectional_iterator_tag,const value_type>
850#if defined(_MSC_VER)&&_MSC_VER==1200
865 typename iterator::reference
operator*()
const{
return *element_by_from(*fit);}
876 iterator(
const fset_iterator& fit):fit(fit){}
880 class const_iterator:
public std::iterator<std::bidirectional_iterator_tag,const value_type>
885#if defined(_MSC_VER)&&_MSC_VER==1200
901 typename const_iterator::reference
operator*()
const{
return *element_by_from(*fit);}
913 const_fset_iterator fit;
916#if defined(_MSC_VER)&&_MSC_VER==1200
918 std::reverse_bidirectional_iterator<
971 fset_iterator fit=
owner().fset.find(&x.first);
972 if(fit!=
owner().fset.end()){
973 return std::make_pair(
iterator(fit),
false);
975 tset_iterator tit=
owner().tset.find(&x.second);
979 tset_iterator tnit=
owner().tset.end();
980 fset_iterator fnit=
owner().fset.end();
982 pe=
owner().new_element(x);
983 tnit=
owner().tset.insert(&pe->second).first;
984 fnit=
owner().fset.insert(&pe->first).first;
986 if(tnit!=
owner().tset.end())
owner().tset.erase(tnit);
987 if(pe)
owner().delete_element(pe);
990 return std::make_pair(
iterator(fnit),
true);
997 tset_iterator tit=
owner().tset.find(&x.second);
1001 tset_iterator tnit=
owner().tset.end();
1002 fset_iterator fnit=
owner().fset.end();
1004 pe=
owner().new_element(x);
1005 tnit=
owner().tset.insert(&pe->second).first;
1006 fnit=
owner().fset.insert(it.fit,&pe->first);
1008 if(tnit!=
owner().tset.end())
owner().tset.erase(tnit);
1009 if(pe)
owner().delete_element(pe);
1015 template<
typename it_type>
1032 iterator
erase(iterator it)
1034 fset_iterator& fit=it.fit;
1035 element * pe=element_by_from(*fit);
1036 tset_iterator tit=
owner().tset.find(&pe->second);
1037 owner().delete_element(pe);
1038 owner().tset.erase(tit);
1039 return(iterator(
owner().fset.erase(fit)));
1044 fset_iterator& fit=it.fit;
1045 element * pe=element_by_from(*fit);
1046 tset_iterator tit=
owner().tset.find(&pe->second);
1047 owner().delete_element(pe);
1048 owner().tset.erase(tit);
1049 owner().fset.erase(fit);
1055 while(first!=last)
erase(first++);
1060 fset_iterator fit=
owner().fset.find(&key);
1061 if(fit==
owner().fset.end())
return 0;
1062 element * pe=element_by_from(*fit);
1063 owner().tset.erase(
owner().tset.find(&pe->second));
1064 owner().fset.erase(fit);
1065 owner().delete_element(pe);
1086 return owner().fset.key_comp().get_compare();
1093 owner().fset.key_comp().get_compare(),
1094 owner().tset.key_comp().get_compare());
1109 return owner().fset.count(&key);
1148 return *
reinterpret_cast<prebimap*
>(
1149 reinterpret_cast<char*
>(
this)-
1154 return *
reinterpret_cast<const prebimap*
>(
1155 reinterpret_cast<const char*
>(
this)-
1159 bool adjacent(const_fset_iterator fit,
const from_type_& f)
const
1161 if(fit==
owner().fset.end()){
1162 if(
owner().fset.size()==0)
return true;
1163 const_fset_iterator fit2=fit;
1165 return owner().fset.key_comp()(*fit2,&f);
1167 else if(
owner().fset.key_comp()(&f,*fit)){
1168 if(fit==
owner().fset.begin())
return true;
1169 const_fset_iterator fit2=fit;
1171 return owner().fset.key_comp()(*fit2,&f);
1174 else if(
owner().fset.key_comp()(*fit,&f)){
1175 const_fset_iterator fit2=fit;
1177 if(fit2==
owner().fset.end())
return true;
1178 return owner().fset.key_comp()(&f,*fit2);
1188 friend class prebimap<from_type_,to_type_,from_compare,to_compare,allocator_type_>;
1200 friend class from_impl::iterator;
1201 friend class from_impl::const_iterator;
1202#elif defined(_MSC_VER)
1203 friend typename from::iterator;
1204 friend typename from::const_iterator;
1207 friend class from_binding<
prebimap>;
1208 friend class const_from_binding<
prebimap>;
1238 std::lexicographical_compare(
1295 class iterator:
public std::iterator<std::bidirectional_iterator_tag,const value_type>
1301#if defined(_MSC_VER)&&_MSC_VER==1200
1315 typename iterator::reference
operator*()
const{
return *element_by_to(*tit);}
1326 iterator(
const tset_iterator& tit):tit(tit){}
1330 class const_iterator:
public std::iterator<std::bidirectional_iterator_tag,const value_type>
1335#if defined(_MSC_VER)&&_MSC_VER==1200
1351 typename const_iterator::reference
operator*()
const{
return *element_by_to(*tit);}
1363 const_tset_iterator tit;
1366#if defined(_MSC_VER)&&_MSC_VER==1200
1368 std::reverse_bidirectional_iterator<
1421 tset_iterator tit=
owner().tset.find(&x.
first);
1422 if(tit!=
owner().tset.end()){
1423 return std::make_pair(
iterator(tit),
false);
1429 fset_iterator fnit=
owner().fset.end();
1430 tset_iterator tnit=
owner().tset.end();
1432 pe=
owner().new_element(x);
1433 fnit=
owner().fset.insert(&pe->first).first;
1434 tnit=
owner().tset.insert(&pe->second).first;
1436 if(fnit!=
owner().fset.end())
owner().fset.erase(fnit);
1437 if(pe)
owner().delete_element(pe);
1440 return std::make_pair(
iterator(tnit),
true);
1451 fset_iterator fnit=
owner().fset.end();
1452 tset_iterator tnit=
owner().tset.end();
1454 pe=
owner().new_element(x);
1455 fnit=
owner().fset.insert(&pe->first).first;
1456 tnit=
owner().tset.insert(it.tit,&pe->second);
1458 if(fnit!=
owner().fset.end())
owner().fset.erase(fnit);
1459 if(pe)
owner().delete_element(pe);
1465 template<
typename it_type>
1478 iterator
erase(iterator it)
1480 tset_iterator& tit=it.tit;
1481 element * pe=element_by_to(*tit);
1482 fset_iterator fit=
owner().fset.find(&pe->first);
1483 owner().delete_element(pe);
1484 owner().fset.erase(fit);
1485 return(iterator(
owner().tset.erase(tit)));
1490 tset_iterator& tit=it.tit;
1491 element * pe=element_by_to(*tit);
1492 fset_iterator fit=
owner().fset.find(&pe->first);
1493 owner().delete_element(pe);
1494 owner().fset.erase(fit);
1495 owner().tset.erase(tit);
1501 while(first!=last)
erase(first++);
1506 tset_iterator tit=
owner().tset.find(&key);
1507 if(tit==
owner().tset.end())
return 0;
1508 element * pe=element_by_to(*tit);
1509 owner().fset.erase(
owner().fset.find(&pe->first));
1510 owner().tset.erase(tit);
1511 owner().delete_element(pe);
1532 return owner().tset.key_comp().get_compare();
1539 owner().tset.key_comp().get_compare(),
1540 owner().fset.key_comp().get_compare());
1555 return owner().tset.count(&key);
1594 return *
reinterpret_cast<prebimap*
>(
1595 reinterpret_cast<char*
>(
this)-
1600 return *
reinterpret_cast<const prebimap*
>(
1601 reinterpret_cast<const char*
>(
this)-
1605 bool adjacent(const_tset_iterator tit,
const to_type_& t)
const
1607 if(tit==
owner().tset.end()){
1608 if(
owner().tset.size()==0)
return true;
1609 const_tset_iterator tit2=tit;
1611 return owner().tset.key_comp()(*tit2,&t);
1613 else if(
owner().tset.key_comp()(&t,*tit)){
1614 if(tit==
owner().tset.begin())
return true;
1615 const_tset_iterator tit2=tit;
1617 return owner().tset.key_comp()(*tit2,&t);
1620 else if(
owner().tset.key_comp()(*tit,&t)){
1621 const_tset_iterator tit2=tit;
1623 if(tit2==
owner().tset.end())
return true;
1624 return owner().tset.key_comp()(&t,*tit2);
1634 friend class prebimap<from_type_,to_type_,from_compare,to_compare,allocator_type_>;
1646 friend class to_impl::iterator;
1647 friend class to_impl::const_iterator;
1648#elif defined(_MSC_VER)
1649 friend typename to::iterator;
1650 friend typename to::const_iterator;
1654 friend class const_to_binding<
prebimap>;
1660 std::pair<typename from_impl::iterator,typename to_impl::iterator>
1669 fit=fset.find(&x.first);
1670 if(fit!=fset.end()){
1671 tset_iterator tnit=tset.find(&x.second);
1672 if(tnit!=tset.end()&&element_by_from(*(fit.fit))==element_by_to(*tnit)){
1673 return std::make_pair(fit,to_iterator(tnit));
1680 tit=tset.find(&x.second);
1686 tset_iterator tnit=tset.begin();
1687 fset_iterator fnit=fset.begin();
1690 tnit=tset.insert(tit.tit,&pe->second);
1691 fnit=fset.insert(fit.fit,&pe->first);
1693 if(tnit!=tset.end())tset.erase(tnit);
1694 if(pe)delete_element(pe);
1697 return std::make_pair(from_iterator(fnit),to_iterator(tnit));
1702 const from_compare& from_comp,
1703 const to_compare& to_comp,
1704 const allocator_type_& al):
1706 fset(p_compare<from_type,from_compare>(from_comp),fset_allocator_type(allocator)),
1707 tset(p_compare<to_type,to_compare>(to_comp),tset_allocator_type(allocator))
1711 allocator(r.allocator),
1712 fset(r.fset.key_comp(),fset_allocator_type(allocator)),
1713 tset(r.tset.key_comp(),tset_allocator_type(allocator))
1717#if defined(_MSC_VER)&&_MSC_VER==1200
1731 std::pair<typename from_impl::iterator,typename to_impl::iterator>
1732 p=
insert(fhint,thint,*it);
1746 for(fset_iterator it=fset.begin();it!=fset.end();++it){
1747 delete_element(element_by_from(*it));
1760 typename from_type,
typename to_type,
1761 typename from_compare,
typename to_compare,
1762 typename allocator_type>
1763struct prebimap_identity
1765 typedef prebimap<from_type,to_type,from_compare,to_compare,allocator_type> type;
1773 typename from_type_,
typename to_type_,
1774 typename from_compare,
typename to_compare,
1775 typename allocator_type_>
1779 public prebimap_identity<from_type_,to_type_,from_compare,to_compare,allocator_type_>::type
1781 public prebimap<from_type_,to_type_,from_compare,to_compare,allocator_type_>
1789 typedef typename super::to::value_type to_value_type;
1790 typedef typename super::to::iterator to_iterator;
1865 to_iterator
insert(to_iterator it,
const to_value_type& x){
return this->
to.
insert(it,x);}
1866 void insert(
const to_value_type *first,
const to_value_type *last)
1870 to_iterator
erase(to_iterator it){
return this->
to.
erase(it);}
1875 void erase(to_iterator first,to_iterator last){this->
to.
erase(first,last);}
1879 const from_compare& from_comp,
1880 const to_compare& to_comp,
1881 const allocator_type_& al):
1882 super(from_comp,to_comp,al)
1894 typename from_type_,
typename to_type_,
1895 typename from_compare,
typename to_compare,
1896 typename allocator_type_>
1900 public prebimap_identity<from_type_,to_type_,from_compare,to_compare,allocator_type_>::type
1902 public prebimap<from_type_,to_type_,from_compare,to_compare,allocator_type_>
1912 typedef typename super::to::key_type to_key_type;
1913 typedef typename super::to::value_type to_value_type;
1914 typedef typename super::to::iterator to_iterator;
1915 typedef typename super::to::const_iterator const_to_iterator;
1989 const_to_binding_t
operator[](
const to_key_type& key)
const{
return this->
to[key];}
1993 to_iterator
insert(to_iterator it,
const to_value_type& x){
return this->
to.
insert(it,x);}
1994 void insert(
const to_value_type *first,
const to_value_type *last)
1998 to_iterator
erase(to_iterator it){
return this->
to.
erase(it);}
2003 void erase(to_iterator first,to_iterator last){this->
to.
erase(first,last);}
2005 to_iterator
find(
const to_key_type& key){
return this->
to.
find(key);}
2006 const_to_iterator
find(
const to_key_type& key)
const{
return this->
to.
find(key);}
2021 const from_compare& from_comp,
2022 const to_compare& to_comp,
2023 const allocator_type_& al):
2024 super(from_comp,to_comp,al)
2036 typename from_type_,
typename to_type_,
2037 typename from_compare=std::less<from_type_>,
2038 typename to_compare=std::less<to_type_>,
2039 typename allocator_type=std::allocator<direct_pair<const from_type_,const to_type_> > >
2043 bimap_detail::equal_types<from_type_,to_type_>::value,
2045 from_type_,to_type_,
2046 from_compare,to_compare,allocator_type>,
2047 bimap_different_types<
2048 from_type_,to_type_,
2049 from_compare,to_compare,allocator_type>
2057 from_type_,to_type_,
2058 from_compare,to_compare,allocator_type>,
2060 from_type_,to_type_,
2061 from_compare,to_compare,allocator_type>
2067 const from_compare& from_comp=from_compare(),
2068 const to_compare& to_comp=to_compare(),
2069 const allocator_type& al=allocator_type()):
2070 super(from_comp,to_comp,al)
2085#if defined(_MSC_VER)&&_MSC_VER==1200
2090 to_type_,from_type_,
2091 to_compare,from_compare,
2092 std::allocator<direct_pair<const to_type_,const from_type_> > >
2096 super(r.to.key_comp(),r.from.key_comp(),allocator_type())
2100 to_type_,from_type_,
2101 to_compare,from_compare,
2102 typename allocator_type::template rebind<
2103 direct_pair<const to_type_,const from_type_> >::other>
2107 super(r.to.key_comp(),r.from.key_comp(),r.get_allocator())
2115#if defined(_MSC_VER)&&_MSC_VER==1200
2119 typename super::from::iterator fhint=from.end();
2120 typename super::to::iterator thint=to.end();
2121 for(
typename inv_bimap::to::const_iterator it=r.to.begin();it!=r.to.end();++it){
2122 insert(fhint,thint,*it);
2125 typename super::from::iterator fhint=this->from.end();
2126 typename super::to::iterator thint=this->to.end();
2127 for(
typename inv_bimap::to::const_iterator it=r.to.begin();it!=r.to.end();++it){
2128 std::pair<typename super::from::iterator,typename super::to::iterator>
2129 p=this->insert(fhint,thint,*it);
2141 template<
typename it_type>
2143 it_type first,it_type last,
2144 const from_compare& from_comp=from_compare(),
2145 const to_compare& to_comp=to_compare(),
2146 const allocator_type& al=allocator_type()):
2147 super(from_comp,to_comp,al)
2151#if defined(_MSC_VER)&&_MSC_VER==1200
2156 typename super::from::iterator fhint=from.end();
2157 typename super::to::iterator thint=to.end();
2159 insert(fhint,thint,first++);
2162 typename super::from::iterator fhint=this->from.end();
2163 typename super::to::iterator thint=this->to.end();
2165 std::pair<typename super::from::iterator,typename super::to::iterator>
2166 p=this->insert(fhint,thint,first++);
2190#elif VERSION_BIMAP_9B698EF9_C6E9_4BC4_A7D2_5B4D71155761!=0x00010003
2191#error You have included two BIMAP.H with different version numbers
#define BIMAP_OFFSETOF_9B698EF9_C6E9_4BC4_A7D2_5B4D71155761(type, member)
#define BIMAP_REBIND_9B698EF9_C6E9_4BC4_A7D2_5B4D71155761(type1, type2)
const bimap_type::to_type & get() const
const_from_binding(const bimap_type &bm, const typename bimap_type::from_type &f)
const bimap_type::from_type & get() const
const_to_binding(const bimap_type &bm, const typename bimap_type::to_type &t)
duplicate_value(const std::string &str)
from_binding & operator=(const typename bimap_type::to_type &t)
from_binding(bimap_type &bm, const typename bimap_type::from_type &f)
const bimap_type::to_type & get() const
to_binding(bimap_type &bm, const typename bimap_type::to_type &t)
to_binding & operator=(const typename bimap_type::from_type &f)
const bimap_type::from_type & get() const
value_not_found(const std::string &str)
super::from::const_reference const_reference
super::from::key_compare key_compare
super::from::value_type value_type
super::from::allocator_type allocator_type
super::from::const_pointer const_pointer
to_iterator lower_bound(const to_key_type &key)
void erase(iterator first, iterator last)
super::from::difference_type difference_type
std::pair< iterator, bool > insert(const value_type &x)
size_type max_size() const
std::pair< iterator, iterator > equal_range(const key_type &key)
std::pair< to_iterator, bool > insert(const to_value_type &x)
super::from::const_iterator const_iterator
size_type count(const key_type &key) const
const_iterator lower_bound(const key_type &key) const
size_type erase(const key_type &key)
iterator insert(iterator it, const value_type &x)
std::pair< const_iterator, const_iterator > equal_range(const key_type &key) const
std::pair< to_iterator, to_iterator > equal_range(const to_key_type &key)
allocator_type get_allocator() const
value_compare value_comp() const
super::from::mapped_type mapped_type
reverse_iterator rbegin()
size_type erase(const to_key_type &key)
super::from::value_compare value_compare
super::from::iterator iterator
super::from::referent_type referent_type
const_to_iterator upper_bound(const to_key_type &key) const
const_to_binding_t operator[](const to_key_type &key) const
super::from::data_type data_type
super::from::reverse_iterator reverse_iterator
super::from::reference reference
const_iterator find(const key_type &key) const
const_iterator end() const
bimap_different_types(const from_compare &from_comp, const to_compare &to_comp, const allocator_type_ &al)
const_reverse_iterator rend() const
void swap(bimap_different_types &x)
super::from::const_reverse_iterator const_reverse_iterator
void erase(to_iterator it)
iterator lower_bound(const key_type &key)
const_to_iterator lower_bound(const to_key_type &key) const
super::from::pointer pointer
void erase(to_iterator first, to_iterator last)
const_iterator upper_bound(const key_type &key) const
const_iterator begin() const
iterator upper_bound(const key_type &key)
super::from::key_type key_type
void insert(const to_value_type *first, const to_value_type *last)
std::pair< const_to_iterator, const_to_iterator > equal_range(const to_key_type &key) const
to_iterator insert(to_iterator it, const to_value_type &x)
iterator find(const key_type &key)
to_iterator upper_bound(const to_key_type &key)
void insert(it_type first, it_type last)
to_iterator find(const to_key_type &key)
key_compare key_comp() const
const_to_iterator find(const to_key_type &key) const
const_from_binding_t operator[](const key_type &key) const
size_type count(const to_key_type &key) const
to_binding_t operator[](const to_key_type &key)
from_binding_t operator[](const key_type &key)
super::from::size_type size_type
const_reverse_iterator rbegin() const
friend void swap(bimap_different_types &x, bimap_different_types &y)
iterator find(const key_type &key)
iterator upper_bound(const key_type &key)
void erase(to_iterator first, to_iterator last)
super::from::reverse_iterator reverse_iterator
super::from::size_type size_type
bimap_equal_types(const from_compare &from_comp, const to_compare &to_comp, const allocator_type_ &al)
void erase(to_iterator it)
super::from::referent_type referent_type
const_iterator upper_bound(const key_type &key) const
void erase(iterator first, iterator last)
super::from::mapped_type mapped_type
const_iterator begin() const
super::from::reference reference
friend void swap(bimap_equal_types &x, bimap_equal_types &y)
size_type erase(const key_type &key)
const_from_binding_t operator[](const key_type &key) const
value_compare value_comp() const
super::from::data_type data_type
super::from::const_reverse_iterator const_reverse_iterator
reverse_iterator rbegin()
std::pair< iterator, bool > insert(const value_type &x)
super::from::const_iterator const_iterator
std::pair< iterator, iterator > equal_range(const key_type &key)
super::from::const_reference const_reference
iterator lower_bound(const key_type &key)
super::from::iterator iterator
to_iterator insert(to_iterator it, const to_value_type &x)
const_reverse_iterator rbegin() const
std::pair< const_iterator, const_iterator > equal_range(const key_type &key) const
const_reverse_iterator rend() const
super::from::const_pointer const_pointer
void insert(const to_value_type *first, const to_value_type *last)
super::from::allocator_type allocator_type
super::from::pointer pointer
key_compare key_comp() const
super::from::difference_type difference_type
size_type count(const key_type &key) const
super::from::key_compare key_compare
from_binding_t operator[](const key_type &key)
allocator_type get_allocator() const
const_iterator find(const key_type &key) const
super::from::key_type key_type
std::pair< to_iterator, bool > insert(const to_value_type &x)
super::from::value_compare value_compare
void swap(bimap_equal_types &x)
const_iterator end() const
size_type max_size() const
iterator insert(iterator it, const value_type &x)
const_iterator lower_bound(const key_type &key) const
void insert(it_type first, it_type last)
super::from::value_type value_type
bimap_detail::select< bimap_detail::equal_types< from_type_, to_type_ >::value, bimap_equal_types< from_type_, to_type_, from_compare, to_compare, allocator_type >, bimap_different_types< from_type_, to_type_, from_compare, to_compare, allocator_type > >::result super
bool operator==(const bimap &r) const
bool operator!=(const bimap &r) const
bool operator<=(const bimap &r) const
bimap & operator=(const bimap &r)
bimap(it_type first, it_type last, const from_compare &from_comp=from_compare(), const to_compare &to_comp=to_compare(), const allocator_type &al=allocator_type())
bimap(const from_compare &from_comp=from_compare(), const to_compare &to_comp=to_compare(), const allocator_type &al=allocator_type())
bool operator<(const bimap &r) const
bimap(const inv_bimap &r)
bimap< to_type_, from_type_, to_compare, from_compare, typename allocator_type::template rebind< direct_pair< const to_type_, const from_type_ > >::other > inv_bimap
bool operator>(const bimap &r) const
bool operator>=(const bimap &r) const
const_iterator(const iterator &it)
const_iterator & operator++()
const_iterator & operator--()
const const_iterator::value_type * operator->() const
bool operator!=(const const_iterator &it) const
bool operator==(const const_iterator &it) const
const const_iterator operator++(int)
const const_iterator operator--(int)
const_iterator::reference operator*() const
bool operator!=(const iterator &it) const
iterator::value_type * operator->() const
iterator::reference operator*() const
const iterator operator--(int)
const iterator operator++(int)
friend class const_iterator
bool operator==(const iterator &it) const
value_compare(key_compare kcomp, to_compare tcomp)
bool operator()(const value_type &x, const value_type &y)
reverse_iterator rbegin()
bool operator==(const from_impl &r) const
size_type count(const key_type &key) const
const_reverse_iterator rbegin() const
const_reverse_iterator rend() const
allocator_type get_allocator() const
bool operator<=(const from_impl &r) const
const prebimap & owner() const
iterator find(const key_type &key)
from_impl & operator=(const from_impl &r)
std::pair< iterator, iterator > equal_range(const key_type &key)
iterator insert(iterator it, const value_type &x)
const_iterator end() const
from_binding< prebimap< from_type_, to_type_, from_compare, to_compare, allocator_type_ > > operator[](const from_type_ &f)
value_compare value_comp() const
size_type erase(const key_type &key)
bool adjacent(const_fset_iterator fit, const from_type_ &f) const
bool operator<(const from_impl &r) const
key_compare key_comp() const
direct_pair< const from_type_, const to_type_ > value_type
std::reverse_iterator< const_iterator > reverse_iterator
iterator upper_bound(const key_type &key)
allocator_type_ allocator_type
std::pair< const_iterator, const_iterator > equal_range(const key_type &key) const
reverse_iterator const_reverse_iterator
const_iterator begin() const
const_iterator find(const key_type &key) const
bool operator>=(const from_impl &r) const
iterator lower_bound(const key_type &key)
const_iterator upper_bound(const key_type &key) const
const value_type & const_reference
bool operator!=(const from_impl &r) const
bool operator>(const from_impl &r) const
void erase(iterator first, iterator last)
from_impl(const from_impl &)
const_iterator lower_bound(const key_type &key) const
void insert(it_type first, it_type last)
const_from_binding< prebimap< from_type_, to_type_, from_compare, to_compare, allocator_type_ > > operator[](const from_type_ &f) const
std::pair< iterator, bool > insert(const value_type &x)
allocator_type_::difference_type difference_type
size_type max_size() const
const value_type * const_pointer
allocator_type_::size_type size_type
friend void swap(from &x, from &y)
const_iterator(const iterator &it)
bool operator==(const const_iterator &it) const
const_iterator & operator--()
bool operator!=(const const_iterator &it) const
const_iterator & operator++()
const const_iterator operator++(int)
const_iterator::reference operator*() const
const const_iterator::value_type * operator->() const
const const_iterator operator--(int)
const iterator operator++(int)
bool operator!=(const iterator &it) const
iterator::reference operator*() const
iterator::value_type * operator->() const
bool operator==(const iterator &it) const
const iterator operator--(int)
friend class const_iterator
bool operator()(const value_type &x, const value_type &y)
value_compare(key_compare kcomp, from_compare fcomp)
allocator_type_::difference_type difference_type
const value_type * const_pointer
bool operator<(const to_impl &r) const
reverse_iterator const_reverse_iterator
value_compare value_comp() const
std::pair< const_iterator, const_iterator > equal_range(const key_type &key) const
const_to_binding< prebimap< from_type_, to_type_, from_compare, to_compare, allocator_type_ > > operator[](const to_type_ &t) const
allocator_type_::size_type size_type
const_iterator begin() const
bool operator>(const to_impl &r) const
std::pair< iterator, iterator > equal_range(const key_type &key)
void erase(iterator first, iterator last)
const_iterator end() const
reverse_iterator rbegin()
to_impl & operator=(const to_impl &r)
std::pair< iterator, bool > insert(const value_type &x)
size_type count(const key_type &key) const
iterator find(const key_type &key)
bool adjacent(const_tset_iterator tit, const to_type_ &t) const
const_iterator upper_bound(const key_type &key) const
std::reverse_iterator< const_iterator > reverse_iterator
bool operator!=(const to_impl &r) const
bool operator==(const to_impl &r) const
allocator_type get_allocator() const
key_compare key_comp() const
allocator_type_ allocator_type
void insert(it_type first, it_type last)
const_iterator lower_bound(const key_type &key) const
bool operator<=(const to_impl &r) const
iterator upper_bound(const key_type &key)
size_type max_size() const
inv_pair< const to_type_, const from_type_ > value_type
bool operator>=(const to_impl &r) const
size_type erase(const key_type &key)
iterator insert(iterator it, const value_type &x)
const value_type & const_reference
to_binding< prebimap< from_type_, to_type_, from_compare, to_compare, allocator_type_ > > operator[](const to_type_ &t)
iterator lower_bound(const key_type &key)
const_reverse_iterator rbegin() const
const_iterator find(const key_type &key) const
const prebimap & owner() const
const_reverse_iterator rend() const
friend void swap(to &x, to &y)
codeproject::prebimap::from from
codeproject::prebimap::to to
prebimap(const prebimap &r)
std::pair< typename from_impl::iterator, typename to_impl::iterator > insert(typename from_impl::iterator fit, typename to_impl::iterator tit, const typename from_impl::value_type &x)
prebimap(const from_compare &from_comp, const to_compare &to_comp, const allocator_type_ &al)
equal_types_no equal_types_helper(...)
bool operator>=(const inv_pair< first_type, second_type > &x, const inv_pair< first_type, second_type > &y)
inv_pair< first_type, second_type > make_inv_pair(const first_type &first, const second_type &second)
bool operator==(const inv_pair< first_type, second_type > &x, const inv_pair< first_type, second_type > &y)
bool operator!=(const inv_pair< first_type, second_type > &x, const inv_pair< first_type, second_type > &y)
bool operator>(const inv_pair< first_type, second_type > &x, const inv_pair< first_type, second_type > &y)
bool operator<(const inv_pair< first_type, second_type > &x, const inv_pair< first_type, second_type > &y)
bool operator<=(const inv_pair< first_type, second_type > &x, const inv_pair< first_type, second_type > &y)
sel::template result< then, els >::type result
selector_switch< test >::result sel
direct_pair(const inv_pair< first_type, second_type > &r)
direct_pair(const std::pair< F, S > &r)
direct_pair(const first_type &first, const second_type &second)
inv_pair(const inv_pair< F, S > &r)
inv_pair(const first_type &first, const second_type &second)
inv_pair(const std::pair< first_type, second_type > &r)
Arg2 second_argument_type
ArgumentType argument_type