Skip to content

Commit 87bb15b

Browse files
committed
[unord.req] Index unordered associative container members in the library
names index, not the main text index.
1 parent eb4d1fe commit 87bb15b

File tree

1 file changed

+35
-58
lines changed

1 file changed

+35
-58
lines changed

source/containers.tex

Lines changed: 35 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -2216,6 +2216,15 @@
22162216
\tcode{z} denotes a value of type \tcode{float},
22172217
and \tcode{nh} denotes a non-const rvalue of type \tcode{X::node_type}.
22182218

2219+
% Local command to index names as members of all unordered containers.
2220+
\newcommand{\indexunordmem}[1]{%
2221+
\indexlibrary{\idxcode{#1}!unordered associative containers}%
2222+
\indexlibrary{\idxcode{unordered_set}!\idxcode{#1}}%
2223+
\indexlibrary{\idxcode{unordered_map}!\idxcode{#1}}%
2224+
\indexlibrary{\idxcode{unordered_multiset}!\idxcode{#1}}%
2225+
\indexlibrary{\idxcode{unordered_multimap}!\idxcode{#1}}%
2226+
}
2227+
22192228
\begin{libreqtab4d}
22202229
{Unordered associative container requirements (in addition to container)}
22212230
{tab:HashRequirements}
@@ -2229,9 +2238,8 @@
22292238
& & \chdr{pre-/post-condition} & \\ \capsep
22302239
\endhead
22312240
%%
2241+
\indexunordmem{key_type}%
22322242
\tcode{X::key_type} &
2233-
\indextext{unordered associative containers!\idxcode{key_type}}%
2234-
\indextext{\idxcode{key_type}!unordered associative containers}%
22352243
\tcode{Key} &
22362244
&
22372245
compile time \\ \rowsep
@@ -2251,49 +2259,46 @@
22512259
\requires\ \tcode{value_type} is \tcode{Erasable} from \tcode{X} &
22522260
compile time \\ \rowsep
22532261

2262+
\indexunordmem{hasher}%
22542263
\tcode{X::hasher}
22552264
& \tcode{Hash}
22562265
& \tcode{Hash} shall be a unary function object type such that the expression
22572266
\tcode{hf(k)} has type \tcode{size_t}.%
2258-
\indextext{unordered associative containers!\idxcode{hasher}}%
2259-
\indextext{\idxcode{hasher}!unordered associative containers}%
22602267
& compile time
22612268
\\ \rowsep
22622269
%
2270+
\indexunordmem{key_equal}%
22632271
\tcode{X::key_equal}
22642272
& \tcode{Pred}
22652273
& \requires\ \tcode{Pred} is \tcode{CopyConstructible}.\br
22662274
\tcode{Pred} shall be a binary predicate that takes two arguments
22672275
of type \tcode{Key}. \tcode{Pred} is an equivalence relation.%
2268-
\indextext{unordered associative containers!\idxcode{key_equal}}%
2269-
\indextext{\idxcode{key_equal}!unordered associative containers}%
22702276
& compile time
22712277
\\ \rowsep
22722278
%
2279+
\indexunordmem{local_iterator}%
22732280
\tcode{X::local_iterator}
22742281
& An iterator type whose category, value type,
22752282
difference type, and pointer and reference types are the same as
22762283
\tcode{X::iterator}'s. \indextext{\idxcode{local_iterator}}
22772284
& A \tcode{local_iterator} object may be used to iterate through a
22782285
single bucket, but may not be used to iterate across
22792286
buckets.%
2280-
\indextext{unordered associative containers!\idxcode{local_iterator}}%
2281-
\indextext{\idxcode{local_iterator}!unordered associative containers}%
22822287
& compile time
22832288
\\ \rowsep
22842289
%
2290+
\indexunordmem{const_local_iterator}%
22852291
\tcode{X::const_local_iterator}
22862292
& An iterator type whose category, value type,
22872293
difference type, and pointer and reference types are the same as
22882294
\tcode{X::const_iterator}'s. \indextext{\idxcode{const_local_iterator}}
22892295
& A \tcode{const_local_iterator} object may be used to iterate through a
22902296
single bucket, but may not be used to iterate across
22912297
buckets.%
2292-
\indextext{unordered associative containers!\idxcode{const_local_iterator}}%
2293-
\indextext{\idxcode{const_local_iterator}!unordered associative containers}%
22942298
& compile time
22952299
\\ \rowsep
22962300
%
2301+
\indexunordmem{node_type}%
22972302
\tcode{X::node_type} &
22982303
a specialization of a \tcode{\placeholder{node_handle}}
22992304
class template, such that the public nested types are
@@ -2431,19 +2436,17 @@
24312436
& Same as \tcode{a = X(il)}.
24322437
\\ \rowsep
24332438
%
2439+
\indexunordmem{hash_function}%
24342440
\tcode{b.hash_function()}
24352441
& \tcode{hasher}
24362442
& Returns \tcode{b}'s hash function.%
2437-
\indextext{unordered associative containers!\idxcode{hash_function}}%
2438-
\indextext{\idxcode{hash_function}!unordered associative containers}%
24392443
& constant
24402444
\\ \rowsep
24412445
%
2446+
\indexunordmem{key_eq}%
24422447
\tcode{b.key_eq()}
24432448
& \tcode{key_equal}
24442449
& Returns \tcode{b}'s key equality predicate.%
2445-
\indextext{unordered associative containers!\idxcode{key_eq}}%
2446-
\indextext{\idxcode{key_eq}!unordered associative containers}%
24472450
& constant
24482451
\\ \rowsep
24492452
%
@@ -2481,6 +2484,7 @@
24812484
Average case \bigoh{1}, worst case \bigoh{\tcode{a.} \tcode{size()}}.
24822485
\\ \rowsep
24832486

2487+
\indexunordmem{insert}%
24842488
\tcode{a_uniq.insert(t)}
24852489
& \tcode{pair<iterator, bool>}
24862490
& \requires\ If \tcode{t} is a non-const rvalue expression, \tcode{value_type} shall be
@@ -2491,8 +2495,6 @@
24912495
component of the returned pair indicates whether the insertion
24922496
takes place, and the \tcode{iterator} component points to the element
24932497
with key equivalent to the key of \tcode{t}.%
2494-
\indextext{unordered associative containers!\idxcode{insert}}%
2495-
\indextext{\idxcode{insert}!unordered associative containers}%
24962498
& Average case \bigoh{1}, worst case \bigoh{\tcode{a_uniq.}\br\tcode{size()}}.
24972499
\\ \rowsep
24982500
%
@@ -2503,8 +2505,6 @@
25032505
\tcode{CopyInsertable} into \tcode{X}.\br
25042506
\effects\ Inserts \tcode{t}, and returns an iterator pointing to the newly
25052507
inserted element.
2506-
\indextext{unordered associative containers!\idxcode{insert}}%
2507-
\indextext{\idxcode{insert}!unordered associative containers}%
25082508
& Average case \bigoh{1}, worst case \bigoh{\tcode{a_eq.}\br\tcode{size()}}.
25092509
\\ \rowsep
25102510
%
@@ -2517,8 +2517,6 @@
25172517
to the element with the key equivalent to that of \tcode{t}. The
25182518
iterator \tcode{p} is a hint pointing to where the search should
25192519
start. Implementations are permitted to ignore the hint.%
2520-
\indextext{unordered associative containers!\idxcode{insert}}%
2521-
\indextext{\idxcode{insert}!unordered associative containers}%
25222520
& Average case \bigoh{1}, worst case \bigoh{\tcode{a.size()}}.
25232521
\\ \rowsep
25242522
%
@@ -2527,8 +2525,6 @@
25272525
& \requires\ \tcode{value_type} shall be \tcode{EmplaceConstructible} into \tcode{X} from \tcode{*i}.\br
25282526
\requires \tcode{i} and \tcode{j} are not iterators in \tcode{a}.\br
25292527
\effects Equivalent to \tcode{a.insert(t)} for each element in \tcode{[i,j)}.%
2530-
\indextext{unordered associative containers!\idxcode{insert}}%
2531-
\indextext{\idxcode{insert}!unordered associative containers}%
25322528
& Average case \bigoh{N}, where $N$ is \tcode{distance(i, j)}.
25332529
Worst case \bigoh{N(\tcode{a.size()}\brk{}+\brk{}1)}.
25342530
\\ \rowsep
@@ -2619,21 +2615,18 @@
26192615
\bigoh{\tcode{a.size()}}.
26202616
\\ \rowsep
26212617
%
2618+
\indexunordmem{erase}%
26222619
\tcode{a.erase(q)}
26232620
& \tcode{iterator}
26242621
& Erases the element pointed to by \tcode{q}. Returns the
26252622
iterator immediately following \tcode{q} prior to the erasure.
2626-
\indextext{unordered associative containers!\idxcode{erase}}%
2627-
\indextext{\idxcode{erase}!unordered associative containers}%
26282623
& Average case \bigoh{1}, worst case \bigoh{\tcode{a.size()}}.
26292624
\\ \rowsep
26302625
%
26312626
\tcode{a.erase(r)}
26322627
& \tcode{iterator}
26332628
& Erases the element pointed to by \tcode{r}. Returns the
26342629
iterator immediately following \tcode{r} prior to the erasure.
2635-
\indextext{unordered associative containers!\idxcode{erase}}%
2636-
\indextext{\idxcode{erase}!unordered associative containers}%
26372630
& Average case \bigoh{1}, worst case \bigoh{\tcode{a.size()}}.
26382631
\\ \rowsep
26392632
%
@@ -2642,148 +2635,132 @@
26422635
& Erases all elements in the range \tcode{[q1, q2)}. Returns
26432636
the iterator immediately following the erased elements prior to the
26442637
erasure.%
2645-
\indextext{unordered associative containers!\idxcode{erase}}%
2646-
\indextext{\idxcode{erase}!unordered associative containers}%
26472638
& Average case linear in \tcode{distance(q1, q2)},
26482639
worst case \bigoh{\tcode{a.size()}}.
26492640
\\ \rowsep
26502641
%
2642+
\indexunordmem{clear}%
26512643
\tcode{a.clear()}
26522644
& \tcode{void}
26532645
& Erases all elements in the container.
26542646
\postconditions \tcode{a.empty()} returns \tcode{true}%
2655-
\indextext{unordered associative containers!\idxcode{clear}}%
2656-
\indextext{\idxcode{clear}!unordered associative containers}%
26572647
& Linear in \tcode{a.size()}.
26582648
\\ \rowsep
26592649
%
2650+
\indexunordmem{find}%
26602651
\tcode{b.find(k)}
26612652
& \tcode{iterator}; \br \tcode{const_iterator} for const \tcode{b}.
26622653
& Returns an iterator pointing to an element with key equivalent to
26632654
\tcode{k}, or \tcode{b.end()} if no such element exists.%
2664-
\indextext{unordered associative containers!\idxcode{find}}%
2665-
\indextext{\idxcode{find}!unordered associative containers}%
26662655
& Average case \bigoh{1}, worst case \bigoh{\tcode{b.size()}}.
26672656
\\ \rowsep
26682657
%
2658+
\indexunordmem{count}%
26692659
\tcode{b.count(k)}
26702660
& \tcode{size_type}
26712661
& Returns the number of elements with key equivalent to \tcode{k}.%
2672-
\indextext{unordered associative containers!\idxcode{count}}%
2673-
\indextext{\idxcode{count}!unordered associative containers}%
26742662
& Average case \bigoh{\tcode{b.count(k)}}, worst case \bigoh{\tcode{b.size()}}.
26752663
\\ \rowsep
26762664
%
2665+
\indexunordmem{equal_range}%
26772666
\tcode{b.equal_range(k)}
26782667
& \tcode{pair<iterator, iterator>}; \br
26792668
\tcode{pair<const_iterator, const_iterator>} for const \tcode{b}.
26802669
& Returns a range containing all elements with keys equivalent to
26812670
\tcode{k}. Returns \tcode{make_pair(b.end(), b.end())} if
26822671
no such elements exist.%
2683-
\indextext{unordered associative containers!\idxcode{equal_range}}%
2684-
\indextext{\idxcode{equal_range}!unordered associative containers}%
26852672
& Average case \bigoh{\tcode{b.count(k)}}. Worst case
26862673
\bigoh{\tcode{b.size()}}.
26872674
\\ \rowsep
26882675
%
2676+
\indexunordmem{bucket_count}%
26892677
\tcode{b.bucket_count()}
26902678
& \tcode{size_type}
26912679
& Returns the number of buckets that \tcode{b} contains.%
2692-
\indextext{unordered associative containers!\idxcode{bucket_count}}%
2693-
\indextext{\idxcode{bucket_count}!unordered associative containers}%
26942680
& Constant
26952681
\\ \rowsep
26962682
%
2683+
\indexunordmem{max_bucket_count}%
26972684
\tcode{b.max_bucket_count()}
26982685
& \tcode{size_type}
26992686
& Returns an upper bound on the number of buckets that \tcode{b} might
27002687
ever contain.%
2701-
\indextext{unordered associative containers!\idxcode{max_bucket_count}}%
2702-
\indextext{\idxcode{max_bucket_count}!unordered associative containers}%
27032688
& Constant
27042689
\\ \rowsep
27052690
%
2691+
\indexunordmem{bucket}%
27062692
\tcode{b.bucket(k)}
27072693
& \tcode{size_type}
27082694
&
27092695
\requires \tcode{b.bucket_count() > 0}.\br
27102696
Returns the index of the bucket in which elements with keys equivalent
27112697
to \tcode{k} would be found, if any such element existed.
27122698
\postconditions the return value shall be in the range \tcode{[0, b.bucket_count())}.%
2713-
\indextext{unordered associative containers!\idxcode{bucket}}%
2714-
\indextext{\idxcode{bucket}!unordered associative containers}%
27152699
& Constant
27162700
\\ \rowsep
27172701
%
2702+
\indexunordmem{bucket_size}%
27182703
\tcode{b.bucket_size(n)}
27192704
& \tcode{size_type}
27202705
& \requires \tcode{n} shall be in the range \tcode{[0, b.bucket_count())}.
27212706
Returns the number of elements in the $\texttt{n}^{\textrm{ th}}$ bucket.%
2722-
\indextext{unordered associative containers!\idxcode{bucket_size}}%
2723-
\indextext{\idxcode{bucket_size}!unordered associative containers}%
27242707
& \bigoh{\tcode{b.bucket_}\-\tcode{size(n)}}
27252708
\\ \rowsep
27262709
%
2710+
\indexunordmem{begin}%
27272711
\tcode{b.begin(n)}
27282712
& \tcode{local_iterator}; \br
27292713
\tcode{const_local_iterator} for const \tcode{b}.
27302714
& \requires \tcode{n} shall be in the range \tcode{[0, b.bucket_count())}.
27312715
\tcode{b.begin(n)} returns an iterator referring to the
27322716
first element in the bucket. If the bucket is empty, then
27332717
\tcode{b.begin(n) == b.end(n)}.%
2734-
\indextext{unordered associative containers!\idxcode{begin}}%
2735-
\indextext{\idxcode{begin}!unordered associative containers}%
27362718
& Constant
27372719
\\ \rowsep
27382720
%
2721+
\indexunordmem{end}%
27392722
\tcode{b.end(n)}
27402723
& \tcode{local_iterator}; \br
27412724
\tcode{const_local_iterator} for const \tcode{b}.
27422725
& \requires \tcode{n} shall be in the range \tcode{[0, b.bucket_count())}.
27432726
\tcode{b.end(n)} returns an iterator which is the past-the-end
27442727
value for the bucket.%
2745-
\indextext{unordered associative containers!\idxcode{end}}%
2746-
\indextext{\idxcode{end}!unordered associative containers}%
27472728
& Constant
27482729
\\ \rowsep
27492730
%
2731+
\indexunordmem{cbegin}%
27502732
\tcode{b.cbegin(n)}
27512733
& \tcode{const_local_iterator}
27522734
& \requires \tcode{n} shall be in the range \tcode{[0, b.bucket_count())}.
27532735
\tcode{b.cbegin(n)} returns an iterator referring to the
27542736
first element in the bucket. If the bucket is empty, then
27552737
\tcode{b.cbegin(n) == b.cend(n)}.%
2756-
\indextext{unordered associative containers!\idxcode{cbegin}}%
2757-
\indextext{\idxcode{cbegin}!unordered associative containers}%
27582738
& Constant
27592739
\\ \rowsep
27602740
%
2741+
\indexunordmem{cend}%
27612742
\tcode{b.cend(n)}
27622743
& \tcode{const_local_iterator}
27632744
& \requires \tcode{n} shall be in the range \tcode{[0, b.bucket_count())}.%
27642745
\tcode{b.cend(n)} returns an iterator which is the past-the-end
27652746
value for the bucket.%
2766-
\indextext{unordered associative containers!\idxcode{cend}}%
2767-
\indextext{\idxcode{cend}!unordered associative containers}%
27682747
& Constant
27692748
\\ \rowsep
27702749
%
2750+
\indexunordmem{load_factor}%
27712751
\tcode{b.load_factor()}
27722752
& \tcode{float}
27732753
& Returns the average number of elements per bucket.%
2774-
\indextext{unordered associative containers!\idxcode{load_factor}}%
2775-
\indextext{\idxcode{load_factor}!unordered associative containers}%
27762754
& Constant
27772755
\\ \rowsep
27782756
%
2757+
\indexunordmem{max_load_factor}%
27792758
\tcode{b.max_load_factor()}
27802759
& \tcode{float}
27812760
& Returns a positive number that the container attempts to keep the load factor
27822761
less than or equal to. The container automatically increases the
27832762
number of buckets as necessary to keep the load factor below this
27842763
number.%
2785-
\indextext{unordered associative containers!\idxcode{max_load_factor}}%
2786-
\indextext{\idxcode{max_load_factor}!unordered associative containers}%
27872764
& Constant
27882765
\\ \rowsep
27892766
%
@@ -2794,15 +2771,15 @@
27942771
& Constant
27952772
\\ \rowsep
27962773
%
2774+
\indexunordmem{rehash}%
27972775
\tcode{a.rehash(n)}
27982776
& \tcode{void}
27992777
& \postconditions \tcode{a.bucket_count() >= a.size() / a.max_load_factor()} and
28002778
\tcode{a.bucket_count() >= n}.%
2801-
\indextext{unordered associative containers!\idxcode{rehash}}%
2802-
\indextext{\idxcode{rehash}!unordered associative containers}%
28032779
& Average case linear in \tcode{a.size()}, worst case quadratic.
28042780
\\ \rowsep
28052781

2782+
\indexunordmem{reserve}%
28062783
\tcode{a.reserve(n)} &
28072784
\tcode{void} &
28082785
Same as \tcode{a.rehash(ceil(n /} \tcode{a.max_load_factor()))}. &

0 commit comments

Comments
 (0)