Quick Links:

bal | bbl | bdl | bsl

Public Member Functions

bslstl::HashTable_HashWrapper< FUNCTOR > Class Template Reference

#include <bslstl_hashtable.h>

List of all members.

Public Member Functions

 HashTable_HashWrapper ()
 HashTable_HashWrapper (const FUNCTOR &fn)
void swap (HashTable_HashWrapper &other)
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< FUNCTOR >

This class provides a wrapper around a functor satisfying the Hash requirements (bslstl_hash) such that the function call operator is always declared as const qualified.

TBD Provide an optimization for the case of an empty base functor, where we can safely const_cast want calling the base class operator.

Note that we would only one class, not two, with C++11 variadic templates and perfect forwarding, and we could also easily detect whether or not FUNCTOR provided a const-qualified operator().

See Component bslstl_hashtable


Constructor & Destructor Documentation

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

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

template<class FUNCTOR>
bslstl::HashTable_HashWrapper< 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

template<class FUNCTOR>
void bslstl::HashTable_HashWrapper< FUNCTOR >::swap ( HashTable_HashWrapper< FUNCTOR > &  other  ) 

Exchange the value of this object with the specified other object.

template<class FUNCTOR>
template<class ARG_TYPE >
std::size_t bslstl::HashTable_HashWrapper< 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.

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

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


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