diff --git a/doc/html/boost_bimap/acknowledgements.html b/doc/html/boost_bimap/acknowledgements.html index df2b8b0..f7b86be 100644 --- a/doc/html/boost_bimap/acknowledgements.html +++ b/doc/html/boost_bimap/acknowledgements.html @@ -3,8 +3,8 @@

diff --git a/doc/html/boost_bimap/bimap_and_boost.html b/doc/html/boost_bimap/bimap_and_boost.html index a894a17..98b3570 100644 --- a/doc/html/boost_bimap/bimap_and_boost.html +++ b/doc/html/boost_bimap/bimap_and_boost.html @@ -3,8 +3,8 @@

[2] +
[2] In the same fashion, Boost.MRU will allow the creation of most recent updated aware containers, hiding the complexity of Boost.MultiIndex. diff --git a/doc/html/boost_bimap/bimap_and_boost/boost_libraries_that_work_well_with_boost_bimap.html b/doc/html/boost_bimap/bimap_and_boost/boost_libraries_that_work_well_with_boost_bimap.html index e238c74..f34785b 100644 --- a/doc/html/boost_bimap/bimap_and_boost/boost_libraries_that_work_well_with_boost_bimap.html +++ b/doc/html/boost_bimap/bimap_and_boost/boost_libraries_that_work_well_with_boost_bimap.html @@ -3,8 +3,8 @@

-
-typedef bimap< std::string, int > bm_type; +typedef bimap< std::string, int > bm_type; // Create a bimap and serialize it to a file { @@ -310,9 +309,9 @@ std::ofstream ofs("data"); boost::archive::text_oarchive oa(ofs); - oa << const_cast<const bm_type&>(bm);+ oa << const_cast<const bm_type&>(bm);
-
const bm_type::left_iterator left_iter = bm.left.find("two"); +
const bm_type::left_iterator left_iter = bm.left.find("two"); oa << left_iter; const bm_type::right_iterator right_iter = bm.right.find(1); @@ -349,14 +348,14 @@
- + We must do a const cast because Boost.Serialization archives only save const objects. Read Boost.Serializartion docs for the rationale behind this decision
- + @@ -376,7 +375,7 @@ in build times, and may be necessary in those defective compilers that fail to correctly process Boost.Serialization headers. - We can only serialize iterators if the bimap was serialized first. Note that the const cast is not requiered here because we create our iterators as const.
+
Warning @@ -404,7 +403,7 @@ must be done only after serializing its corresponding container. -+@@ -434,12 +433,11 @@-
- typedef bimap< multiset_of< int >, list_of< std::string > > bm_type; +typedef bimap< multiset_of< int >, list_of< std::string > > bm_type; // We can use assign::list_of to initialize the container. - bm_type bm = assign::list_of< bm_type::relation >+ bm_type bm = assign::list_of< bm_type::relation >
( 1, "one" ) ( 2, "two" ) ( 3, "three" ); @@ -476,7 +474,7 @@
- + Note that
bm_type::relationhas to be used instead ofbm_type::value_type. Contrary tovalue_type,relation@@ -487,7 +485,7 @@-
+@@ -508,12 +506,12 @@ results.-- Boost.Hash can be extended + Boost.Hash can be extended for custom data types, enabling to use the default parameter of the unordered set types with any user types.
+@@ -539,8 +537,7 @@--
-typedef bimap< std::string, int > bm_type; +typedef bimap< std::string, int > bm_type; bm_type bm; bm.insert( bm_type::value_type("one",1) ); @@ -557,7 +554,7 @@
+@@ -585,8 +582,7 @@--
-template< class ForwardReadableRange, class UnaryFunctor > +template< class ForwardReadableRange, class UnaryFunctor > UnaryFunctor for_each(const ForwardReadableRange & r, UnaryFunctor func) { typedef typename @@ -630,8 +626,7 @@-
-struct pair_printer +struct pair_printer { pair_printer(std::ostream & o) : os(o) {} template< class Pair > @@ -688,7 +683,7 @@ Go to source code+@@ -712,8 +707,7 @@--
-typedef bimap< std::string, list_of<int> > bm_type; +typedef bimap< std::string, list_of<int> > bm_type; bm_type bm; bm.insert( bm_type::value_type("1", 1) ); @@ -723,7 +717,7 @@ BOOST_FOREACH( bm_type::left_reference p, bm.left ) { - ++p.second;+ ++p.second;
} BOOST_FOREACH( bm_type::right_const_reference p, bm.right ) @@ -739,7 +733,7 @@
@@ -755,8 +749,7 @@
- + We can modify the right element because we have use a mutable collection type in the right side.
-
-BOOST_FOREACH( bm_type::left_reference p, +BOOST_FOREACH( bm_type::left_reference p, ( bm.left.range( std::string("1") <= _key, _key < std::string("3") ) )) { ++p.second; @@ -776,21 +769,19 @@ Go to source code+-Once C++0x is out we are going to be able to write code like:
--auto iter = bm.by<name>().find("john"); +auto iter = bm.by<name>().find("john");instead of the more verbose
--bm_type::map_by<name>::iterator iter = bm.by<name>().find("john"); +bm_type::map_by<name>::iterator iter = bm.by<name>().find("john");Boost.Typeof defines a macro BOOST_AUTO that can be used as a library solution @@ -804,8 +795,7 @@
-
-typedef bimap< tagged<std::string,name>, tagged<int,number> > bm_type; +typedef bimap< tagged<std::string,name>, tagged<int,number> > bm_type; bm_type bm; bm.insert( bm_type::value_type("one" ,1) ); bm.insert( bm_type::value_type("two" ,2) ); @@ -822,8 +812,7 @@-
-for( bm_type::map_by<name>::iterator iter = bm.by<name>().begin(); +for( bm_type::map_by<name>::iterator iter = bm.by<name>().begin(); iter!=bm.by<name>().end(); ++iter) { std::cout << iter->first << " --> " << iter->second << std::endl; @@ -844,8 +833,7 @@-
-for( BOOST_AUTO(iter, bm.by<name>().begin()); iter!=bm.by<name>().end(); ++iter) +for( BOOST_AUTO(iter, bm.by<name>().begin()); iter!=bm.by<name>().end(); ++iter) { std::cout << iter->first << " --> " << iter->second << std::endl; } @@ -861,7 +849,7 @@ Go to source code+@@ -875,8 +863,7 @@--
-typedef bimap< std::string, int > bm_type; +typedef bimap< std::string, int > bm_type; bm_type bm; std::string rel_str("one <--> 1 two <--> 2 three <--> 3"); @@ -900,7 +887,7 @@ Go to source code+@@ -928,8 +915,7 @@ are read-write property maps. In order to use these, you need to include one of the following headers: --#include <boost/bimap/property_map/set_support.hpp> +#include <boost/bimap/property_map/set_support.hpp> #include <boost/bimap/property_map/unordered_set_support.hpp>@@ -944,8 +930,7 @@
-
-template <typename AddressMap> +template <typename AddressMap> void foo(AddressMap & address_map) { typedef typename boost::property_traits<AddressMap>::value_type value_type; diff --git a/doc/html/boost_bimap/bimap_and_boost/dependencies.html b/doc/html/boost_bimap/bimap_and_boost/dependencies.html index 9997604..d27c96a 100644 --- a/doc/html/boost_bimap/bimap_and_boost/dependencies.html +++ b/doc/html/boost_bimap/bimap_and_boost/dependencies.html @@ -3,8 +3,8 @@Dependencies - - + + @@ -14,15 +14,15 @@Home Libraries -People -FAQ +People +FAQ More
-+@@ -35,7 +35,7 @@ is the heart of this library.-Table 1.4. Boost Libraries needed by Boost.Bimap
+Table 1.4. Boost Libraries needed by Boost.Bimap
@@ -184,7 +184,7 @@
-Table 1.6. Additional Boost Libraries needed to run +
Table 1.6. Additional Boost Libraries needed to run the test-suite
diff --git a/doc/html/boost_bimap/compiler_specifics.html b/doc/html/boost_bimap/compiler_specifics.html index 9bcce77..9028932 100644 --- a/doc/html/boost_bimap/compiler_specifics.html +++ b/doc/html/boost_bimap/compiler_specifics.html @@ -3,8 +3,8 @@
Compiler specifics - - + + @@ -14,15 +14,15 @@Home Libraries -People -FAQ +People +FAQ More
-+@@ -325,7 +325,7 @@- + VS 7.1
@@ -334,7 +334,7 @@ in msdn is to split the .cpp in several files or upgrade your compiler.
- + VS 8.0
@@ -346,8 +346,7 @@ In order to turn off the warnings add the followings defines at the begging of your .cpp files:
--#define _CRT_SECURE_NO_DEPRECATE +#define _CRT_SECURE_NO_DEPRECATE #define _SCL_SECURE_NO_DEPRECATEdiff --git a/doc/html/boost_bimap/examples.html b/doc/html/boost_bimap/examples.html index c22bd1f..a202f47 100644 --- a/doc/html/boost_bimap/examples.html +++ b/doc/html/boost_bimap/examples.html @@ -3,8 +3,8 @@Examples - - + + @@ -14,15 +14,15 @@Home Libraries -People -FAQ +People +FAQ More
-+@@ -35,7 +35,7 @@-MultiIndex to Bimap Path - Hashed indices +@@ -44,7 +44,7 @@ find all the examples used in bimap documentation. Here is a list of them:
-Table 1.9. Boost.MultiIndex to Boost.Bimap path examples
+Table 1.9. Boost.MultiIndex to Boost.Bimap path examples
diff --git a/doc/html/boost_bimap/examples/mighty_bimap.html b/doc/html/boost_bimap/examples/mighty_bimap.html index b851364..0226d7d 100644 --- a/doc/html/boost_bimap/examples/mighty_bimap.html +++ b/doc/html/boost_bimap/examples/mighty_bimap.html @@ -3,8 +3,8 @@ Mighty Bimap - - + + @@ -14,15 +14,15 @@Home Libraries -People -FAQ +People +FAQ More
-+@@ -38,8 +38,7 @@-
-#include <iostream> +#include <iostream> #include <string> #include <boost/bimap/bimap.hpp> #include <boost/bimap/list_of.hpp> diff --git a/doc/html/boost_bimap/examples/multiindex_to_bimap_path___bidirectional_map.html b/doc/html/boost_bimap/examples/multiindex_to_bimap_path___bidirectional_map.html index 619e8d2..5d0efe9 100644 --- a/doc/html/boost_bimap/examples/multiindex_to_bimap_path___bidirectional_map.html +++ b/doc/html/boost_bimap/examples/multiindex_to_bimap_path___bidirectional_map.html @@ -3,8 +3,8 @@MultiIndex to Bimap Path - Bidirectional Map - - + + @@ -14,15 +14,15 @@Home Libraries -People -FAQ +People +FAQ More
-+MultiIndex to Bimap Path - Bidirectional Map @@ -42,7 +42,7 @@
- + Boost.MultiIndex
@@ -54,8 +54,7 @@
-
-#include <iostream> +#include <iostream> #include <boost/tokenizer.hpp> #include <boost/multi_index_container.hpp> @@ -151,7 +150,7 @@
- + Boost.Bimap
@@ -163,8 +162,7 @@
-
-#include <iostream> +#include <iostream> #include <boost/tokenizer.hpp> #include <boost/bimap/bimap.hpp> @@ -200,7 +198,7 @@ // the second part of the element is the equivalent in English std::cout << word << " is said " - << it->second+ << it->second
<< " in English" << std::endl; } else @@ -211,7 +209,7 @@ if( it2 != d.right.end() ) { std::cout << word << " is said " - << it2->second
+ << it2->second
<< " in Spanish" << std::endl; } else @@ -231,13 +229,13 @@
- +
itis an iterator of the left view, soit->secondrefers to the right element of the relation, the word in english- + @@ -259,8 +257,7 @@
it2is an iterator of the right view, soit2->secondrefers to the left element of the relation, the word in spanish-
-#include <iostream> +#include <iostream> #include <boost/bimap/bimap.hpp> diff --git a/doc/html/boost_bimap/examples/multiindex_to_bimap_path___hashed_indices.html b/doc/html/boost_bimap/examples/multiindex_to_bimap_path___hashed_indices.html index a3daee5..fc150a8 100644 --- a/doc/html/boost_bimap/examples/multiindex_to_bimap_path___hashed_indices.html +++ b/doc/html/boost_bimap/examples/multiindex_to_bimap_path___hashed_indices.html @@ -3,8 +3,8 @@MultiIndex to Bimap Path - Hashed indices - - + + @@ -14,15 +14,15 @@Home Libraries -People -FAQ +People +FAQ More
-+MultiIndex to Bimap Path - Hashed indices @@ -40,7 +40,7 @@
- + Boost.MultiIndex
@@ -52,8 +52,7 @@
-
-#include <iostream> +#include <iostream> #include <iomanip> #include <boost/tokenizer.hpp> @@ -141,7 +140,7 @@
- + Boost.Bimap
@@ -152,8 +151,7 @@
-
-#include <iostream> +#include <iostream> #include <iomanip> #include <boost/tokenizer.hpp> diff --git a/doc/html/boost_bimap/examples/simple_bimap.html b/doc/html/boost_bimap/examples/simple_bimap.html index d107ba6..b143f1e 100644 --- a/doc/html/boost_bimap/examples/simple_bimap.html +++ b/doc/html/boost_bimap/examples/simple_bimap.html @@ -3,8 +3,8 @@Simple Bimap - - + + @@ -14,15 +14,15 @@Home Libraries -People -FAQ +People +FAQ More
-+@@ -37,8 +37,7 @@-
-#include <string> +#include <string> #include <iostream> #include <boost/bimap.hpp> @@ -110,8 +109,7 @@-
-#include <iostream> +#include <iostream> #include <boost/bimap.hpp> @@ -142,12 +140,12 @@ std::cout << "Countries names ordered by their final position:" << std::endl; -for( results_bimap::map_by<place>::const_iterator +
for( results_bimap::map_by<place>::const_iterator i = results.by<place>().begin(), iend = results.by<place>().end() ; i != iend; ++i ) { -
std::cout << i->get<place >() << ") " +
std::cout << i->get<place >() << ") " << i->get<country>() << std::endl; } @@ -156,7 +154,7 @@ "their final position:" << std::endl; -
for( results_bimap::map_by<country>::const_iterator +
for( results_bimap::map_by<country>::const_iterator i = results.by<country>().begin(), iend = results.by<country>().end() ; i != iend; ++i ) @@ -177,18 +175,18 @@
- +
results.by<place>()is equivalent toresults.right- +
get<Tag>works for each view of the bimap- + diff --git a/doc/html/boost_bimap/future_work.html b/doc/html/boost_bimap/future_work.html index 8547b64..5d80742 100644 --- a/doc/html/boost_bimap/future_work.html +++ b/doc/html/boost_bimap/future_work.html @@ -3,8 +3,8 @@
results.by<country>()is equivalent toresults.leftFuture work - - + + @@ -14,20 +14,20 @@Home Libraries -People -FAQ +People +FAQ More
-+- + Rearrange Function
diff --git a/doc/html/boost_bimap/history.html b/doc/html/boost_bimap/history.html index a13e3f4..beb5b3c 100644 --- a/doc/html/boost_bimap/history.html +++ b/doc/html/boost_bimap/history.html @@ -3,8 +3,8 @@
History - - + + @@ -14,15 +14,15 @@Home Libraries -People -FAQ +People +FAQ More
-+@@ -32,7 +32,7 @@-MultiIndex and Bimap +The long path from Code Project to Boost diff --git a/doc/html/boost_bimap/history/multiindex_and_bimap.html b/doc/html/boost_bimap/history/multiindex_and_bimap.html index 6c92c91..2f7745d 100644 --- a/doc/html/boost_bimap/history/multiindex_and_bimap.html +++ b/doc/html/boost_bimap/history/multiindex_and_bimap.html @@ -3,8 +3,8 @@
MultiIndex and Bimap - - + + @@ -14,15 +14,15 @@Home Libraries -People -FAQ +People +FAQ More
-+MultiIndex and Bimap @@ -95,8 +95,7 @@
-
-// Data structure itself +// Data structure itself template<typename ValueType,typename KeyType> struct Node; template<typename ValueType,typename KeyType> @@ -141,8 +140,7 @@-
-ptree_gen<string,string>::type PT; +ptree_gen<string,string>::type PT; boost::archive::text_iarchive ia( std::ifstream ifs("filename") ); ia >> PT; string value = get( "a.b.c.d", PT ); diff --git a/doc/html/boost_bimap/introduction.html b/doc/html/boost_bimap/introduction.html index c0bba66..a7001b0 100644 --- a/doc/html/boost_bimap/introduction.html +++ b/doc/html/boost_bimap/introduction.html @@ -3,8 +3,8 @@Introduction - - + + @@ -14,20 +14,20 @@Home Libraries -People -FAQ +People +FAQ More
-+ --+
-
Note @@ -88,7 +88,7 @@ and enjoy!+
Important @@ -102,72 +102,72 @@- + Navigation
Used in combination with the configured browser key (usually Alt), the following keys act as handy shortcuts for common navigation tasks.
--
- -General
-
- +
+
- +General
-+
- -
p- Previous page- +
- -
n- Next page- +
- -
h- home- +
u- Up- -Main TOC
-
- +
- +Main TOC
diff --git a/doc/html/boost_bimap/one_minute_tutorial.html b/doc/html/boost_bimap/one_minute_tutorial.html index 156c6a5..7dd4483 100644 --- a/doc/html/boost_bimap/one_minute_tutorial.html +++ b/doc/html/boost_bimap/one_minute_tutorial.html @@ -3,8 +3,8 @@+
- -
i- Introduction- +
- -
o- One minute tutorial- +
- -
t- The tutorial- +
- -
b- Bimap and Boost- +
- -
r- Reference- +
- -
c- Compiler specifics- +
- -
v- Performance- +
- -
e- Examples- +
- -
s- Test Suite- +
- -
f- Future work- +
- -
m- Release notes- +
- -
w- Rationale- +
- -
y- History- +
a- AcknowledgementsOne minute tutorial - - + + @@ -14,20 +14,20 @@Home Libraries -People -FAQ +People +FAQ More
-+- + What is a bimap?
@@ -46,23 +46,22 @@The following code creates an empty bimap container:
--typedef bimap<X,Y> bm_type; +typedef bimap<X,Y> bm_type; bm_type bm;Given this code, the following is the complete description of the resulting bimap. - [1] + [1]
--
- +
+
- -
bm.leftis signature-compatible withstd::map<X,Y>- +
- -
bm.rightis signature-compatible withstd::map<Y,X>- +
- @@ -77,8 +76,7 @@
bmis signature-compatible withstd::set< relation<X,Y> >If we have any generic function that work with maps
--template< class MapType > +template< class MapType > void print_map(const MapType & m) { typedef typename MapType::const_iterator const_iterator; @@ -92,8 +90,7 @@ We can use the left map view and the right map view with it --bimap< int, std::string > bm; +bimap< int, std::string > bm; ... print_map( bm.left ); print_map( bm.right ); @@ -109,7 +106,7 @@ ...- + Layout of the relation and the pairs of a bimap
@@ -123,14 +120,13 @@![]()
- + Step by step
A convinience header is avaiable in the boost directory:
--#include <boost/bimap.hpp> +#include <boost/bimap.hpp>Lets define a bidirectional map between integers and strings: @@ -140,8 +136,7 @@
-
-typedef boost::bimap< int, std::string > bm_type; +typedef boost::bimap< int, std::string > bm_type; bm_type bm;@@ -149,7 +144,7 @@
- + The collection of relations view
@@ -163,8 +158,7 @@-
-bm.insert( bm_type::value_type(1, "one" ) ); +bm.insert( bm_type::value_type(1, "one" ) ); bm.insert( bm_type::value_type(2, "two" ) ); std::cout << "There are " << bm.size() << "relations" << std::endl; @@ -183,7 +177,7 @@
- + The left map view
@@ -198,8 +192,7 @@-
-typedef bm_type::left_map::const_iterator left_const_iterator; +
typedef bm_type::left_map::const_iterator left_const_iterator; for( left_const_iterator left_iter = bm.left.begin(), iend = bm.left.end(); left_iter != iend; ++left_iter ) @@ -210,10 +203,10 @@ std::cout << left_iter->first << " --> " << left_iter->second << std::endl; } -
bm_type::left_const_iterator left_iter = bm.left.find(2); +
bm_type::left_const_iterator left_iter = bm.left.find(2); assert( left_iter->second == "two" ); -
bm.left.insert( bm_type::left_value_type( 3, "three" ) ); +
bm.left.insert( bm_type::left_value_type( 3, "three" ) );
@@ -223,18 +216,18 @@
- + The type of
bm.leftisbm_type::left_mapand the type ofbm.rightisbm_type::right_map- +
bm_type::left_-type- can be used as a shortcut for the more verbosebm_type::left_map::-type-- @@ -244,7 +237,7 @@+ This line produces the same effect of
bm.insert( bm_type::value_type(3,"three") );
- + The right map view
@@ -259,8 +252,7 @@-
-bm_type::right_const_iterator right_iter = bm.right.find("two"); +bm_type::right_const_iterator right_iter = bm.right.find("two"); // right_iter->first : key : std::string // right_iter->second : data : int @@ -271,7 +263,7 @@ bm.right.erase("two"); -bm.right.insert( bm_type::right_value_type( "four", 4 ) ); +
bm.right.insert( bm_type::right_value_type( "four", 4 ) );
@@ -280,7 +272,7 @@
@@ -289,7 +281,7 @@
- + Differences with std::map
@@ -303,16 +295,14 @@ However dereferencing abimap<X,Y>::left_iteratorreturns a type that is signature-compatible with astd::pair<const X, const Y>--bm.left.find(1)->second = "1"; // Compilation error +bm.left.find(1)->second = "1"; // Compilation errorIf you insert
-(1,"one")and(1,"1")in astd::map<int,std::string>the second insertion will have no effect. In abimap<X,Y>both keys have to remain unique. The insertion may fail in other situtions too. Lets see an example-bm.clear(); +bm.clear(); bm.insert( bm_type::value_type( 1, "one" ) ); @@ -322,7 +312,7 @@ assert( bm.size() == 1 );- + A simple example
@@ -337,8 +327,7 @@
-
-#include <string> +#include <string> #include <iostream> #include <boost/bimap.hpp> @@ -419,7 +408,7 @@Spain ends in position 2- + Continuing the journey
@@ -428,7 +417,7 @@ or read the reference section of this documentation. -+
Caution @@ -445,7 +434,7 @@
-[1] +
[1] A type is signature-compatible with other type if it has the same signature for functions and metadata. Preconditions, postconditions and the order of operations need not be the same. diff --git a/doc/html/boost_bimap/performance.html b/doc/html/boost_bimap/performance.html index b974d09..ad9714b 100644 --- a/doc/html/boost_bimap/performance.html +++ b/doc/html/boost_bimap/performance.html @@ -3,8 +3,8 @@
Performance - - + + @@ -14,15 +14,15 @@Home Libraries -People -FAQ +People +FAQ More
-+diff --git a/doc/html/boost_bimap/rationale.html b/doc/html/boost_bimap/rationale.html index ecab6be..9fba32b 100644 --- a/doc/html/boost_bimap/rationale.html +++ b/doc/html/boost_bimap/rationale.html @@ -3,8 +3,8 @@Rationale - - + + @@ -14,15 +14,15 @@Home Libraries -People -FAQ +People +FAQ More
-+@@ -46,7 +46,7 @@ of email flowed between Joaquin and Matias. The juiciest parts of the conversations where extracted and rearranged here. -+
-
Note @@ -57,7 +57,7 @@ at developers.+@@ -79,8 +79,7 @@ The following interface is necessary for therelationclass: --typedef -unspecified- TA; typedef -unspecified- TB; +typedef -unspecified- TA; typedef -unspecified- TB; TA a, ai; TB b, bi; @@ -132,16 +131,16 @@ is very simple, and it is based heavily on the concepts of the STL. Given abimap<A,B> bm: --
- +
+
- -
bm.leftis signature-compatible with astd::map<A,B>- +
- -
bm.rightis signature-compatible with astd::map<B,A>- +
- @@ -154,7 +153,7 @@ as being simple and powerful. This is the general design.
bmis signature-compatible with astd::set<relation<A,B> >- + Relation Implementation
@@ -169,8 +168,7 @@ has two references named first and second that bind toAandB, or toBandA. --relation<TA,TB> r; +relation<TA,TB> r; const_reference_pair<A,B> pba(r); const_reference_pair<B,A> pbb(r); @@ -195,8 +193,7 @@ clause that is not currently in the standard but is very natural. The additional clause imposes that if we have two classes: --struct class_a_b +struct class_a_b { Type1 name_a; Type2 name_b; @@ -245,7 +242,7 @@ both cases, because we require that the same code be compilable by any standards-compliant compiler. -+
Note @@ -257,7 +254,7 @@- + Bimap Implementation
diff --git a/doc/html/boost_bimap/rationale/additional_features.html b/doc/html/boost_bimap/rationale/additional_features.html index 79749ca..c5a2c35 100644 --- a/doc/html/boost_bimap/rationale/additional_features.html +++ b/doc/html/boost_bimap/rationale/additional_features.html @@ -3,8 +3,8 @@Additional Features - - + + @@ -14,21 +14,21 @@Home Libraries -People -FAQ +People +FAQ More
-+- + N-1, N-N, hashed maps
@@ -40,12 +40,12 @@ collection type of each key directly. In order to implement this feature, we have to solve two problems: --
- +
+
- The index types of the
-multi_index_containercore now depends on the collection type used for each key.- +
- The map views now change their semantics according to the collection type chosen.
@@ -60,7 +60,7 @@![]()
- + Collection type of relation constraints
@@ -72,29 +72,29 @@ bases the collection type of relations on the left collection type, but the user may choose between: --
- +
@@ -104,7 +104,7 @@ uses further metaprogramming to define a new index if necessary.+
- left_based
-- +
- right_based
-- +
- set_of_relation<>
-- +
- multiset_of_relation<>
-- +
- unordered_set_of_relation<>
-- +
- unordered_multiset_of_relation<>
-- +
- list_of
-- +
- vector_of
- + Tagged
diff --git a/doc/html/boost_bimap/rationale/code.html b/doc/html/boost_bimap/rationale/code.html index b009f90..e885a42 100644 --- a/doc/html/boost_bimap/rationale/code.html +++ b/doc/html/boost_bimap/rationale/code.html @@ -3,8 +3,8 @@
Code - - + + @@ -14,15 +14,15 @@Home Libraries -People -FAQ +People +FAQ More
-+@@ -34,7 +34,7 @@ Library Requirement and Guidelines as closely as possible.-Table 1.11. folders in each folder
+Table 1.11. folders in each folder
diff --git a/doc/html/boost_bimap/rationale/the_student_and_the_mentor.html b/doc/html/boost_bimap/rationale/the_student_and_the_mentor.html index 78db622..ab4caaf 100644 --- a/doc/html/boost_bimap/rationale/the_student_and_the_mentor.html +++ b/doc/html/boost_bimap/rationale/the_student_and_the_mentor.html @@ -3,8 +3,8 @@ The student and the mentor - - + + @@ -14,20 +14,20 @@Home Libraries -People -FAQ +People +FAQ More
-+-+
Tip @@ -751,8 +751,7 @@-
-relation<TA,TB> r; +relation<TA,TB> r; const_reference_pair<A,B> pba(r); const_reference_pair<B,A> pbb(r);@@ -1292,8 +1291,7 @@-
-map_view x=...; +map_view x=...; map_view y=...; x=y;diff --git a/doc/html/boost_bimap/reference.html b/doc/html/boost_bimap/reference.html index 13f3cec..7b06a2c 100644 --- a/doc/html/boost_bimap/reference.html +++ b/doc/html/boost_bimap/reference.html @@ -3,8 +3,8 @@Reference - - + + @@ -14,15 +14,15 @@Home Libraries -People -FAQ +People +FAQ More
-+@@ -89,7 +89,7 @@ Views-+@@ -99,54 +99,54 @@Convenience
-
- +
- "boost/bimap.hpp" (includes "boost/bimap/bimap.hpp" and imports the bimap class to boost namespace)
Container
-
- +
- "boost/bimap/bimap.hpp" (includes "boost/bimap/set_of.hpp" and "boost/bimap/unconstrained_set_of.hpp")
Set Types
--
- +
+
- "boost/bimap/set_of.hpp"
-- +
- "boost/bimap/multiset_of.hpp"
-- +
- "boost/bimap/unordered_set_of.hpp"
-- +
- "boost/bimap/unordered_multiset_of.hpp"
-- +
- "boost/bimap/list_of.hpp"
-- +
- "boost/bimap/vector_of.hpp"
-- +
- "boost/bimap/unconstrained_set_of.hpp"
Boost Integration
--
- +
diff --git a/doc/html/boost_bimap/reference/bimap_reference.html b/doc/html/boost_bimap/reference/bimap_reference.html index d601fc1..93c0dc6 100644 --- a/doc/html/boost_bimap/reference/bimap_reference.html +++ b/doc/html/boost_bimap/reference/bimap_reference.html @@ -3,8 +3,8 @@+
- "boost/bimap/support/lambda.hpp"
-- +
- "boost/bimap/property_map/set_support.hpp"
-- +
- "boost/bimap/property_map/unordered_set_support.hpp"
Bimap Reference - - + + @@ -14,15 +14,15 @@Home Libraries -People -FAQ +People +FAQ More
-+@@ -53,7 +53,7 @@-- Serialization
+View concepts @@ -79,25 +79,25 @@ (such as uniqueness of elements). The global operations performed jointly in the any view can be reduced to six primitives: -
-
- +
+
- copying
-- +
- insertion of an element
-- +
- hinted insertion, where a pre-existing element is suggested in order to improve the efficiency of the operation
-- +
- deletion of an element
-- +
- replacement of the value of an element, which may trigger the rearrangement of this element in one or more views, or may forbid the replacement
-- +
- modification of an element, and its subsequent rearrangement/banning by the various views
@@ -113,7 +113,7 @@-
+Complexity signature @@ -129,28 +129,28 @@ its complexity signature, consisting of the following associated functions on the number of elements: -
-
- +
+
- -
c(n): copying- +
- -
i(n): insertion- +
- -
h(n): hinted insertion- +
- -
d(n): deletion- +
- -
r(n): replacement- +
- @@ -168,22 +168,22 @@ to denote the above view, the complexity of insertion will now be
m(n): modifyingO(i_l(n)+i_r(n)+i_a(n)). To abbreviate the notation, we adopt the following definitions: ---
C(n) = c_l(n) + c_r(n) [ + ++
- -
C(n) = c_l(n) + c_r(n) [ + c_a(n) ]I(n) = i_l(n) + i_r(n) [ + +- -
I(n) = i_l(n) + i_r(n) [ + i_a(n) ]H(n) = h_l(n) + h_r(n) [ + +- -
H(n) = h_l(n) + h_r(n) [ + h_a(n) ]D(n) = d_l(n) + d_r(n) [ + +- -
D(n) = d_l(n) + d_r(n) [ + d_a(n) ]R(n) = r_l(n) + r_r(n) [ + +- -
R(n) = r_l(n) + r_r(n) [ + r_a(n) ]M(n) = m_l(n) + m_r(n) [ + +M(n) = m_l(n) + m_r(n) [ + m_a(n) ]+Set type specification @@ -377,7 +377,7 @@
+@@ -387,13 +387,12 @@ uses the tagged idiom to let the user specify this tags.-+---namespace boost { +namespace boost { namespace bimaps { template< class Type, typename Tag > @@ -485,7 +484,7 @@ } // namespace boost+Class template bimap @@ -507,7 +506,7 @@
This is the main component of Boost.Bimap.
-+@@ -516,7 +515,7 @@ we adopt the scheme outlined in the complexity signature section.-+Instantiation types @@ -525,32 +524,31 @@
bimapis instantiated with the following types: --
- +
-+
- LeftCollectionType and RightCollectionType are collection type specifications optionally tagged, or any type optionally tagged, in which case that side acts as a set.
-- +
- AdditionalParameter_{1/2} can be any ordered subset of: -
-
- +
+
- CollectionTypeOfRelation specification
-- +
- Allocator
+---left_tag, right_tag +left_tag, right_tag-@@ -563,8 +561,7 @@
-left_key_type, right_key_type +left_key_type, right_key_type-@@ -577,8 +574,7 @@
-left_data_type, right_data_type +left_data_type, right_data_type-@@ -591,8 +587,7 @@
-left_value_type, right_value_type +left_value_type, right_value_type-@@ -604,8 +599,7 @@
-left_iterator, right_iterator +left_iterator, right_iterator left_const_iterator, right_const_iterator-@@ -618,8 +612,7 @@
-left_map, right_map +left_map, right_map@@ -632,97 +625,92 @@
+--bimap(); +bimap();--
- +
-+
- Effects: Constructs an empty
-bimap.- +
- Complexity: Constant.
-template<typename InputIterator> +template<typename InputIterator> bimap(InputIterator first,InputIterator last);--
- +
-+
- Requires:
-InputIteratoris a model of Input Iterator over elements of typerelationor a type convertible torelation. last is reachable fromfirst.- +
- Effects: Constructs an empty
-bimapand fills it with the elements in the range[first,last). Insertion of each element may or may not succeed depending on acceptance by the collection types of thebimap.- +
- Complexity: O(m*H(m)), where m is the number of elements in
[first,last).-bimap(const bimap & x); +bimap(const bimap & x);--
- +
-+
- Effects: Constructs a copy of x, copying its elements as well as its internal objects (key extractors, comparison objects, allocator.)
-- +
- Postconditions:
-*this == x. The order of the views of thebimapis preserved as well.- +
- Complexity: O(x.size()*log(x.size()) + C(x.size()))
-~bimap() +~bimap()--
- +
-+
- Effects: Destroys the
-bimapand all the elements contained. The order in which the elements are destroyed is not specified.- +
- Complexity: O(n).
-bimap& operator=(const bimap& x); +bimap& operator=(const bimap& x);--
- +
+
- Effects: Replaces the elements and internal objects of the
-bimapwith copies from x.- +
- Postconditions:
-*this==x. The order on the views of thebimapis preserved as well.- +
- Returns:
-*this.- +
- Complexity: O(n + x.size()*log(x.size()) + C(x.size())).
-- +
- Exception safety: Strong, provided the copy and assignment operations of the types of
ctor_args_listdo not throw. @@ -731,7 +719,7 @@-
+Projection operations @@ -741,164 +729,158 @@ v1 and v2, we say than an v1-iterator it1 and an v2-iterator it2 are equivalent if: -
-
- +
-+
- -
it1 == i1.end()ANDit2 == i2.end(),- +
- OR
it1andit2point to the same element.-template< class IteratorType > +template< class IteratorType > left_iterator project_left(IteratorType iter); template< class IteratorType > left_const_iterator project_left(IteratorType iter) const;--
- +
-+
- Requires:
-IteratorTypeis a bimap view iterator. it is a valid iterator of some view of*this(i.e. does not refer to some otherbimap.)- +
- Effects: Returns a left map view iterator equivalent to
-it.- +
- Complexity: Constant.
-- +
- Exception safety: nothrow.
-template< class IteratorType > +template< class IteratorType > right_iterator project_right(IteratorType iter); template< class IteratorType > right_const_iterator project_right(IteratorType iter) const;--
- +
-+
- Requires:
-IteratorTypeis a bimap view iterator. it is a valid iterator of some view of*this(i.e. does not refer to some otherbimap.)- +
- Effects: Returns a right map view iterator equivalent to
-it.- +
- Complexity: Constant.
-- +
- Exception safety: nothrow.
-template< class IteratorType > +template< class IteratorType > iterator project_up(IteratorType iter); template< class IteratorType > const_iterator project_up(IteratorType iter) const;--
- +
+
- Requires:
-IteratorTypeis a bimap view iterator. it is a valid iterator of some view of*this(i.e. does not refer to some otherbimap.)- +
- Effects: Returns a collection of relations view iterator equivalent to
-it.- +
- Complexity: Constant.
-- +
- Exception safety: nothrow.
-
+--template< class Tag > +template< class Tag > struct map_by;--
- +
-+
- -
map_by<Tag>::typeyields the type of the map view tagged withTag.map_by<Tag>::-type name- is the same asmap_by<Tag>::type::-type name-.- +
- Requires:
Tagis a valid user defined name of the bimap.-template< class Tag > +template< class Tag > map_by<Tag>::type by(); template< class Tag > const map_by<Tag>::type & by() const;--
- +
-+
- Requires:
-Tagis a valid user defined name of the bimap.- +
- Effects: Returns a reference to the map view tagged with
-Tagheld by*this.- +
- Complexity: Constant.
-- +
- Exception safety: nothrow.
-template< class Tag, class IteratorType > +template< class Tag, class IteratorType > map_by<Tag>::iterator project(IteratorType iter); template< class Tag, class IteratorType > map_by<Tag>::const_iterator project(IteratorType iter) const---
- +
+
- Requires:
-Tagis a valid user defined name of the bimap.IteratorTypeis a bimap view iterator. it is a valid iterator of some view of*this(i.e. does not refer to some otherbimap.)- +
- Effects: Returns a reference to the map view tagged with
-Tagheld by*this.- +
- Complexity: Constant.
-- +
- Exception safety: nothrow.
+@@ -925,7 +907,7 @@ is serialization-compatible withpif --
- +
p(x,y) == q(x',y')@@ -940,12 +922,12 @@ to an output archive (XML archive) ar.
-
- +
-+
- Requires: Value is serializable (XML-serializable). Additionally, each of the views of b can impose other requirements.
-- +
- Exception safety: Strong with respect to
b. If an exception is thrown, ar may be left in an inconsistent state. @@ -958,13 +940,13 @@ archive) ar.-
- +
+
- Requires: Value is serializable (XML-serializable). Additionally, each of the views of
-b' can impose other requirements.- +
- Exception safety: Basic. If an exception is thrown, ar may be left in an inconsistent state.
diff --git a/doc/html/boost_bimap/reference/list_of_reference.html b/doc/html/boost_bimap/reference/list_of_reference.html index 8fd0023..1d467d5 100644 --- a/doc/html/boost_bimap/reference/list_of_reference.html +++ b/doc/html/boost_bimap/reference/list_of_reference.html @@ -3,8 +3,8 @@list_of Reference - - + + @@ -14,15 +14,15 @@Home Libraries -People -FAQ +People +FAQ More
-+@@ -48,13 +48,12 @@-- Serialization
+---namespace boost { +namespace boost { namespace bimaps { @@ -68,7 +67,7 @@ } // namespace boost+list_of Views @@ -109,17 +108,17 @@
There are a number of differences with respect to
-std::lists:-
- +
+
- list_of views are not Assignable (like any other view.)
-- +
- Unlike as in
-std::list, insertions into a list_of view may fail due to clashings with other views. This alters the semantics of the operations provided with respect to their analogues instd::list.- +
- Elements in a list_of view are not mutable, and can only be changed by means of
replaceandmodifymember functions. @@ -133,8 +132,7 @@ and operations that are either not present in the concepts modeled or do not exactly conform to the requirements for these types of containers. --namespace boost { +namespace boost { namespace bimaps { namespace views { @@ -295,15 +293,13 @@In the set view:
--typedef signature-compatible with relation< Left, ... > key_type; +typedef signature-compatible with relation< Left, ... > key_type; typedef signature-compatible with relation< Left, ... > value_type;In the left map view:
--typedef Left key_type; +typedef Left key_type; typedef ... data_type; typedef signature-compatible with std::pair< Left, ... > value_type; @@ -311,15 +307,14 @@In the right map view:
--typedef ... key_type; +typedef ... key_type; typedef Left data_type; typedef signature-compatible with std::pair< ... , Left > value_type;-
+Complexity signature @@ -329,28 +324,28 @@ views, we adopt the scheme outlined in the complexity signature section. The complexity signature of a
list_ofview is: ---
- +
+
- copying:
-c(n) = n * log(n),- +
- insertion:
-i(n) = 1(constant),- +
- hinted insertion:
-h(n) = 1(constant),- +
- deletion:
-d(n) = 1(constant),- +
- replacement:
-r(n) = 1(constant),- +
- modifying:
m(n) = 1(constant).+Instantiation types @@ -361,16 +356,16 @@ specified by means of the collection type specifiers and the bimap itself. Instantiations are dependent on the following types: -
--
- +
+
- -
Valuefromlist_of,- +
Allocatorfrombimap,+Constructors, copy and assignment @@ -379,27 +374,25 @@ As explained in the view concepts section, views do not have public constructors or destructors. Assignment, on the other hand, is provided. -
-this_type & operator=(const this_type & x); +this_type & operator=(const this_type & x);--
- +
+
- Effects:
-a = b;where a and b are thebimapobjects to which*thisandxbelong, respectively.- +
- Returns:
*this.-
-template< class InputIterator > +template< class InputIterator > void assign(InputIterator first, InputIterator last);--
- +
+
- Requires:
-InputIteratoris a model of Input Iterator over elements of typevalue_type@@ -408,16 +401,15 @@lastis reachable fromfirst.- +
- Effects:
clear(); insert(end(),first,last);-
-void assign(size_type n, const value_type & value); +void assign(size_type n, const value_type & value);--
- +
- Effects:
clear(); for(size_type i = 0; @@ -426,18 +418,17 @@ ++n) push_back(v);+-
-void resize(size_type n,const value_type& x=value_type()); +void resize(size_type n,const value_type& x=value_type());---
- +
+
- Effects:
-if( n > size() ) insert(end(), n - size(), @@ -445,28 +436,27 @@ it = begin();std::advance(it, n);erase(it, end());}- +
- Note: If an expansion is requested, the size of the view is not guaranteed to be n after this operation (other views may ban insertions.)
+-
-std::pair<iterator,bool> push_front(const value_type& x); +std::pair<iterator,bool> push_front(const value_type& x);--
- +
+
- Effects: Inserts
-xat the beginning of the sequence if no other views of thebimapbans the insertion.- +
- Returns: The return value is a pair
-p.p.secondistrueif and only if @@ -475,26 +465,25 @@ points to an element that caused the insertion to be banned. Note that more than one element can be causing insertion not to be allowed.- +
- Complexity: O(I(n)).
-- +
- Exception safety: Strong.
-
-std::pair<iterator,bool> push_back(const value_type & x); +std::pair<iterator,bool> push_back(const value_type & x);--
- +
+
- Effects: Inserts
-xat the end of the sequence if no other views of thebimapbans the insertion.- +
- Returns: The return value is a pair
-p.p.secondistrueif and only if @@ -503,31 +492,30 @@ points to an element that caused the insertion to be banned. Note that more than one element can be causing insertion not to be allowed.- +
- Complexity: O(I(n)).
-- +
- Exception safety: Strong.
-
-std::pair<iterator,bool> insert(iterator position, const value_type & x); +std::pair<iterator,bool> insert(iterator position, const value_type & x);--
- +
+
- Requires:
-positionis a validiteratorof the view.- +
- Effects: Inserts
-xbefore position if insertion is allowed by all other views of thebimap.- +
- Returns: The return value is a pair
-p.p.secondistrueif and only if @@ -536,26 +524,25 @@ points to an element that caused the insertion to be banned. Note that more than one element can be causing insertion not to be allowed.- +
- Complexity: O(I(n)).
-- +
- Exception safety: Strong.
-
-void insert(iterator position, size_type n, const value_type & x); +void insert(iterator position, size_type n, const value_type & x);--
- +
+
- Requires:
-positionis a validiteratorof the view.- +
- Effects:
for(size_type i = 0; @@ -566,12 +553,11 @@-
-template< class InputIterator> +template< class InputIterator> void insert(iterator position,InputIterator first,InputIterator last);--
- +
+
- Requires:
-positionis a validiteratorof the view.InputIterator@@ -582,99 +568,96 @@ this view belongs.lastis reachable fromfirst.- +
- Effects:
-while(first != last) insert(position, *first++);- +
- Complexity: O(m*I(n+m)), where m is the number of elements in
-[first,last).- +
- Exception safety: Basic.
-
-iterator erase(iterator position); +iterator erase(iterator position);--
- +
+
- Requires:
-positionis a valid dereferenceableiteratorof the view.- +
- Effects: Deletes the element pointed to by
-position.- +
- Returns: An iterator pointing to the element immediately following the one that was deleted, or
-end()if no such element exists.- +
- Complexity: O(D(n)).
-- +
- Exception safety: nothrow.
-
-iterator erase(iterator first, iterator last); +iterator erase(iterator first, iterator last);--
- +
+
- Requires:
-[first,last)is a valid range of the view.- +
- Effects: Deletes the elements in
-[first,last).- +
- Returns:
-last.- +
- Complexity: O(m*D(n)), where m is the number of elements in
-[first,last).- +
- Exception safety: nothrow.
-
-bool replace(iterator position,const value_type& x); +bool replace(iterator position,const value_type& x);--
- +
+
- Requires:
-positionis a valid dereferenceable iterator of the view.- +
- Effects: Assigns the value
-xto the element pointed to bypositioninto thebimapto which the view belongs if replacing is allowed by all other views of thebimap.- +
- Postconditions: Validity of
-positionis preserved in all cases.- +
- Returns:
-trueif the replacement took place,falseotherwise.- +
- Complexity: O(R(n)).
-- +
- Exception safety: Strong. If an exception is thrown by some user-provided operation the
bimapto which the view belongs remains in its original state. @@ -682,17 +665,16 @@-
-template< class CompatibleKey > +template< class CompatibleKey > bool replace_key(iterator position, const CompatibleKey & x);--
- +
+
- Requires:
-positionis a valid dereferenceable iterator of the set view.CompatibleKeycan be assigned tokey_type.- +
- Effects: Assigns the value
-xtoe.first, whereeis the element pointed to byposition@@ -700,20 +682,20 @@ the set view belongs if replacing is allowed by all other views of thebimap.- +
- Postconditions: Validity of position is preserved in all cases.
-- +
- Returns:
-trueif the replacement took place,falseotherwise.- +
- Complexity: O(R(n)).
-- +
- Exception safety: Strong. If an exception is thrown by some user-provided operation, the
bimapto which the set view belongs remains in its original state. @@ -721,17 +703,16 @@-
-template< class CompatibleData > +template< class CompatibleData > bool replace_data(iterator position, const CompatibleData & x);--
- +
+
- Requires:
-positionis a valid dereferenceable iterator of the set view.CompatibleKeycan be assigned todata_type.- +
- Effects: Assigns the value
-xtoe.second, whereeis the element pointed to byposition@@ -739,20 +720,20 @@ the set view belongs if replacing is allowed by all other views of thebimap.- +
- Postconditions: Validity of position is preserved in all cases.
-- +
- Returns:
-trueif the replacement took place,falseotherwise.- +
- Complexity: O(R(n)).
-- +
- Exception safety: Strong. If an exception is thrown by some user-provided operation, the
bimapto which the set view belongs remains in its original state. @@ -760,90 +741,88 @@-
-template< class KeyModifier > +template< class KeyModifier > bool modify_key(iterator position, KeyModifier mod);--
- +
+
- Requires:
-KeyModifieris a model of Unary Function accepting arguments of type:key_type&;positionis a valid dereferenceable iterator of the view.- +
- Effects: Calls
-mod(e.first)where e is the element pointed to by position and rearranges*positioninto all the views of thebimap. If the rearrangement fails, the element is erased. It is successful if the rearrangement is allowed by all other views of thebimap.- +
- Postconditions: Validity of
-positionis preserved if the operation succeeds.- +
- Returns:
-trueif the operation succeeded,falseotherwise.- +
- Complexity: O(M(n)).
-- +
- Exception safety: Basic. If an exception is thrown by some user-provided operation (except possibly mod), then the element pointed to by position is erased.
-- +
- Note: Only provided for map views.
-
-template< class DataModifier > +template< class DataModifier > bool modify_data(iterator position, DataModifier mod);---
- +
+
- Requires:
-DataModifieris a model of Unary Function accepting arguments of type:data_type&;positionis a valid dereferenceable iterator of the view.- +
- Effects: Calls
-mod(e.second)where e is the element pointed to by position and rearranges*positioninto all the views of thebimap. If the rearrangement fails, the element is erased. It is successful if the rearrangement is allowed by all other views of thebimap.- +
- Postconditions: Validity of
-positionis preserved if the operation succeeds.- +
- Returns:
-trueif the operation succeeded,falseotherwise.- +
- Complexity: O(M(n)).
-- +
- Exception safety: Basic. If an exception is thrown by some user-provided operation (except possibly mod), then the element pointed to by position is erased.
-- +
- Note: Only provided for map views.
+List operations @@ -859,67 +838,64 @@
-
-void splice(iterator position, this_type & x); +void splice(iterator position, this_type & x);--
- +
+
- Requires:
-positionis a valid iterator of the view.&x!=this.- +
- Effects: Inserts the contents of
-xbefore position, in the same order as they were inx. Those elements successfully inserted are erased fromx.- +
- Complexity: O(
-x.size()*I(n+x.size()) +x.size()*D(x.size())).- +
- Exception safety: Basic.
-
-void splice(iterator position, this_type & x,iterator i); +void splice(iterator position, this_type & x,iterator i);--
- +
+
- Requires:
-positionis a valid iterator of the view.iis a valid dereferenceable iteratorx.- +
- Effects: Inserts the element pointed to by
-ibefore position: if insertion is successful, the element is erased fromx. In the special case&x==this, no copy or deletion is performed, and the operation is always successful. Ifposition==i, no operation is performed.- +
- Postconditions: If
-&x==this, no iterator or reference is invalidated.- +