
On 12/10/24 17:50, Vinnie Falco wrote:
On Tue, Dec 10, 2024 at 5:09 AM Andrey Semashev via Boost
mailto:boost@lists.boost.org> 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.