Boost logo

Boost :

From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2024-12-06 14:41:07


On 12/6/24 17:34, Peter Dimov via Boost wrote:
> Andrey Semashev wrote:
>
>>> https://github.com/pdimov/hash2/blob/develop/include/boost/hash2/hash_append_fwd.hpp
>>
>> Forward declarations are kind of fragile and they limit future evolution of the
>> library. And they are tedious to add, considering that they would be needed
>> everywhere where hashing support is needed. I would rather prefer the
>> approach that doesn't need forward declarations.
>
> Maybe. Something could probably be figured out, but I don't think your
> sketch would be it.
>
> We can't (or rather, don't want to) require from hash algorithm authors
> to provide the full hash_append functionality via member functions, and
> wrapping doesn't work that well, at least in my head.
>
> Maybe I need to pass a helper object that provides the hash_append API
> as member functions.

Yes, that sounds good to me.

> Abusing the tag for that would be a bit too clever. :-)

On that note, what's the use of the tag argument? I have only seen
hash_append_tag so far, and I don't think adding new tags in the future
would be any different from using separate functions (i.e. to support a
new tag would require about the same amount of user's code modifications
as adding a new friend function to the user's classes).


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk