Quick Links: |
#include <bslstl_hashtable.h>
Public Member Functions | |
HashTable_ComparatorWrapper () | |
HashTable_ComparatorWrapper (const FUNCTOR &fn) | |
template<class ARG1_TYPE , class ARG2_TYPE > | |
bool | operator() (ARG1_TYPE &arg1, ARG2_TYPE &arg2) const |
const FUNCTOR & | functor () const |
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.
See Component bslstl_hashtable
bslstl::HashTable_ComparatorWrapper< const FUNCTOR >::HashTable_ComparatorWrapper | ( | ) |
Create a HashTable_ComparatorWrapper
object wrapping a FUNCTOR
that has its default value.
bslstl::HashTable_ComparatorWrapper< const FUNCTOR >::HashTable_ComparatorWrapper | ( | const FUNCTOR & | fn | ) | [explicit] |
Create a HashTable_ComparatorWrapper
object wrapping a FUNCTOR
that is a copy of the specified fn
.
bool bslstl::HashTable_ComparatorWrapper< const FUNCTOR >::operator() | ( | ARG1_TYPE & | arg1, | |
ARG2_TYPE & | arg2 | |||
) | const |
Call the wrapped functor
with the specified arg1
and arg2
(in that order) and return the result. Note that ARGn_TYPE
will typically be deduced as a const
type.
const FUNCTOR& bslstl::HashTable_ComparatorWrapper< const FUNCTOR >::functor | ( | ) | const |
Return a reference providing non-modifiable access to the hash functor wrapped by this object.