* thomas:
> any ideas for this one?
>
> --code--
> template<>
> class ACE_Hash<KeyType>
> {
> public:
> u_long operator() (const KeyType kt) const
> {
> int val = kt;
> return (u_long)val;
> }
> };
> --code--
>
> while "operator u_long (void) const; " may be easily understood as a
> conversion operator;
> what does "u_long operator() (const KeyType kt) const;" mean?
'operator()' is the function call operator.
Given
KeyType const key = ...;
ACE_Hash<KeyType> hash;
you can use the hash object as a function
u_long const x = hash( key );
in order to obtain the result of first converting key to int and then
further to u_long, whatever that type is.
Cheers, & hth.,
- Alf
--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
|