BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bslstl::HashTable_HashWrapper< const FUNCTOR > Class Template Reference

#include <bslstl_hashtable.h>

Public Member Functions

 HashTable_HashWrapper ()
 
 HashTable_HashWrapper (const FUNCTOR &fn)
 
template<class ARG_TYPE >
std::size_t operator() (ARG_TYPE &arg) const
 
const FUNCTOR & functor () const
 

Detailed Description

template<class FUNCTOR>
class bslstl::HashTable_HashWrapper< const FUNCTOR >

This partial specialization handles const qualified functors, that may not be stored as a mutable member in the primary template. The need to wrap such functors diminishes greatly, as there is no need to play mutable tricks to invoke the function call operator. An alternative to providing this specialization would be to skip the wrapper entirely if using a const qualified functor in a HashTable. Note that this type has a const qualified data member, so is neither assignable nor swappable.

Constructor & Destructor Documentation

◆ HashTable_HashWrapper() [1/2]

template<class FUNCTOR >
bslstl::HashTable_HashWrapper< const FUNCTOR >::HashTable_HashWrapper ( )

Create a HashTable_HashWrapper object wrapping a FUNCTOR that has its default value.

◆ HashTable_HashWrapper() [2/2]

template<class FUNCTOR >
bslstl::HashTable_HashWrapper< const FUNCTOR >::HashTable_HashWrapper ( const FUNCTOR &  fn)
explicit

Create a HashTable_HashWrapper object wrapping a FUNCTOR that is a copy of the specified fn.

Member Function Documentation

◆ functor()

template<class FUNCTOR >
const FUNCTOR & bslstl::HashTable_HashWrapper< const FUNCTOR >::functor ( ) const

Return a reference providing non-modifiable access to the hash functor wrapped by this object.

◆ operator()()

template<class FUNCTOR >
template<class ARG_TYPE >
std::size_t bslstl::HashTable_HashWrapper< const FUNCTOR >::operator() ( ARG_TYPE &  arg) const

Call the wrapped functor with the specified arg and return the result. Note that ARG_TYPE will typically be deduced as a const type.


The documentation for this class was generated from the following file: