Skip to main content

std::unordered_map begin( size_type ) method

// Non const version
local_iterator begin( size_type n );

// Const version
const_local_iterator begin( size_type n ) const;

// Const version
const_local_iterator cbegin( size_type n ) const;

Returns an iterator to the first element of the bucket with index n.

Parameters

  • n - the index of the bucket to access

Return value

Iterator to the first element.

Complexity

Constant - O(1).

Exceptions

(none)

Examples

important

This section requires improvement. You can help by editing this doc page.

This article originates from this CppReference page. It was likely altered for improvements or editors' preference. Click "Edit this page" to see all changes made to this document.
Hover to see the original license.

std::unordered_map begin( size_type ) method

// Non const version
local_iterator begin( size_type n );

// Const version
const_local_iterator begin( size_type n ) const;

// Const version
const_local_iterator cbegin( size_type n ) const;

Returns an iterator to the first element of the bucket with index n.

Parameters

  • n - the index of the bucket to access

Return value

Iterator to the first element.

Complexity

Constant - O(1).

Exceptions

(none)

Examples

important

This section requires improvement. You can help by editing this doc page.

This article originates from this CppReference page. It was likely altered for improvements or editors' preference. Click "Edit this page" to see all changes made to this document.
Hover to see the original license.