|
Boost : |
From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2024-12-10 15:05:06
On 12/10/24 17:50, Vinnie Falco wrote:
> On Tue, Dec 10, 2024 at 5:09â¯AM Andrey Semashev via Boost
> <boost_at_[hidden] <mailto:boost_at_[hidden]>> wrote:
>
> Copyability is a rather strong requirement,
> which may not be supported by all implementations.
>
> Could you please provide an example of a non-copyable HashAlgorithm? I'm
> struggling to see it.
The primary use case I had in mind is wrapping an external library,
where the external library does not support creating a deep copy of the
algorithm state. This is the case with libsodium
(https://doc.libsodium.org/hashing/generic_hashing), for example.
In general, copyability requires support from whatever is being copied,
movability does not (as you can always store a pointer and move that).
Since the need for HashAlgorithm's copyability is rather limited, I
think it makes sense to not require it, if possible.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk