diff --git a/doc/fusion.qbk b/doc/fusion.qbk index c8d97fcf..ea880d8d 100644 --- a/doc/fusion.qbk +++ b/doc/fusion.qbk @@ -161,6 +161,7 @@ [def __make_vector__ [link fusion.sequences.generation.functions.make_vector `make_vector`]] [def __result_of_make_vector__ [link fusion.sequences.generation.metafunctions.make_vector `result_of::make_vector`]] [def __vector_tie__ [link fusion.sequences.generation.functions.vector_tie `vector_tie`]] +[def __map_tie__ [link fusion.sequences.generation.functions.vector_tie `map_tie`]] [def __result_of_vector_tie__ [link fusion.sequences.generation.metafunctions.vector_tie `result_of::vector_tie`]] [def __make_vector__ [link fusion.sequences.generation.functions.make_vector `make_vector`]] [def __result_of_make_vector__ [link fusion.sequences.generation.metafunctions.make_vector `result_of::make_vector`]] diff --git a/doc/sequences.qbk b/doc/sequences.qbk index 3abeca63..99dec662 100644 --- a/doc/sequences.qbk +++ b/doc/sequences.qbk @@ -2604,6 +2604,7 @@ succeeding sections document the various /tier/ flavors. * __list_tie__ * __vector_tie__ +* __map_tie__ Example: @@ -2730,6 +2731,57 @@ default. Example: [endsect] +[section map_tie] + +[heading Description] + +Constructs a tie using a __map__ sequence. + +[heading Synopsis] + + template + __map__<__pair__, __pair__,... __pair__ > + map_tie(D0& d0, D1& d1... DN& dN); + +The variadic function accepts `0` to `FUSION_MAX_MAP_SIZE` elements, +where `FUSION_MAX_MAP_SIZE` is a user definable predefined maximum that +defaults to `10`, and a corresponding number of key types. +You may define the preprocessor constant `FUSION_MAX_MAP_SIZE` before +including any Fusion header to change the default. Example: + + #define FUSION_MAX_MAP_SIZE 20 + +[heading Parameters] + +[table + [[Parameter] [Requirement] [Description]] + [[`K0, K1,... KN`] [Any type][The key types associated with each of the `x1,x2,...,xN` values]] + [[`x0, x1,... xN`] [Instances of `T0, T1,... TN`] [The arguments to `map_tie`]] +] + +[heading Expression Semantics] + + map_tie(x0, x1,... xN); + +[*Return type]: __map__<__pair__, __pair__,... __pair__ > + +[*Semantics]: Create a __map__ of references from `x0, x1,... xN` with keys `K0, K1,... KN` + +[heading Header] + + #include + +[heading Example] + + struct int_key; + struct double_key; + ... + int i = 123; + double d = 123.456; + map_tie(i, d) + +[endsect] + [endsect] [section MetaFunctions] @@ -3051,6 +3103,54 @@ default. Example: [endsect] +[section map_tie] + +[heading Description] + +Returns the result type of __map_tie__. + +[heading Synopsis] + + template + struct map_tie; + +The variadic function accepts `0` to `FUSION_MAX_MAP_SIZE` elements, +where `FUSION_MAX_MAP_SIZE` is a user definable predefined maximum that +defaults to `10`. You may define the preprocessor constant +`FUSION_MAX_MAP_SIZE` before including any Fusion header to change the +default. Example: + + #define FUSION_MAX_MAP_SIZE 20 + +[heading Parameters] + +[table + [[Parameter] [Requirement] [Description]] + [[`K0, K1,... KN`] [Any type] [The key types for `map_tie`]] + [[`D0, D1,... DN`] [Any type] [The arguments types for `map_tie`]] +] + +[heading Expression Semantics] + + result_of::map_tie::type; + +[*Return type]: __map__<__pair__, __pair__,... __pair__ > + +[*Semantics]: Create a __map__ of references from `D0, D1,... DN` with keys `K0, K1,... KN` + +[heading Header] + + #include + +[heading Example] + + struct int_key; + struct double_key; + ... + result_of::map_tie::type + +[endsect] + [endsect] [endsect] diff --git a/todo.txt b/todo.txt index d04ae545..913c5609 100644 --- a/todo.txt +++ b/todo.txt @@ -25,7 +25,7 @@ How about making joint_view Concept preserving? This way push/pop/front/back will return a view of the same Concept. - tosh -* map_tie is implemented. It seems not yet documented? +* map_tie is implemented. It seems not yet documented? - Dan: done now! * multi_set, multi_map?