[botan-devel] Private copy constructor for Algorithm

William K. Foster wkf at alum.mit.edu
Tue Jul 26 09:15:33 EDT 2011


In algo_base/algo_base.h I see this code:

class BOTAN_DLL Algorithm
      Algorithm(const Algorithm&) {}

Which causes my code to not compile:

  const SHA_512 &myHash = *static_cast<SHA_512 *>(_hash);
  SHA_512 tmpHash(myHash);

  _hashedHash = tmpHash.final();

  Assert(_hashedHash.size() >= _hashOutputSize);

Should I be doing this another way or should this copy constructor be made
protected instead of private?  I want to call final() on a temporary copy so
that I can see its size(), but not affect the original as the ultimate
final() is not ready, this is just an interim point.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.randombit.net/pipermail/botan-devel/attachments/20110726/92fdc32d/attachment.html>

More information about the botan-devel mailing list