[#BloombergLP-bslstl-HashTable-bucketIndexForKey-00]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslstl.adoc[bslstl]::xref:BloombergLP/bslstl/HashTable.adoc[HashTable]::bucketIndexForKey
:relfileprefix: ../../../
:mrdocs:

Return the bucket index for the specified `key`&period;

== Synopsis

Declared in `&lt;bslstl&lowbar;hashtable&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bslstl/HashTable/SizeType.adoc[HashTable&lt;KEY&lowbar;CONFIG, HASHER, COMPARATOR, ALLOCATOR&gt;::SizeType]
bucketIndexForKey(xref:BloombergLP/bslstl/HashTable/KeyType.adoc[KeyType] const& key) const;
----

== Description

Return the index of the bucket that would contain all the elements having the specified `key`&period;

== Return Value

index of the bucket that would contain elements with `key`

== Parameters

[cols="1,4"]
|===
| Name| Description
| *key*
| key whose bucket index is returned
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
