PointStamp represents an infinite vector of T elements, extending a maintained vector with T::minimum(). This allows multiple representations of the same vector when the vector is allowed to end with T::minimum(), which was documented as acceptable. However, it does mean that e.g. the derived Eq implementation, among others, would report two logically identical pointstamps as different, and imo the position that there can be multiple unequal representations of the same state is untenable.
This PR removes that ability, short of direct manipulation by users, through an enforce method that is called by a constructor, and use of that constructor whenever we mint new PointStamps. Demonstration uses that manipulate vector directly are followed by enforce calls.
We could go further and make the field private, and prevent direct manipulation and require clones (or at least into_vec and from_vec patterns). That might increase confidence even further.
PointStamp
represents an infinite vector ofT
elements, extending a maintainedvector
withT::minimum()
. This allows multiple representations of the same vector when thevector
is allowed to end withT::minimum()
, which was documented as acceptable. However, it does mean that e.g. the derivedEq
implementation, among others, would report two logically identical pointstamps as different, and imo the position that there can be multiple unequal representations of the same state is untenable.This PR removes that ability, short of direct manipulation by users, through an
enforce
method that is called by a constructor, and use of that constructor whenever we mint newPointStamp
s. Demonstration uses that manipulatevector
directly are followed byenforce
calls.We could go further and make the field private, and prevent direct manipulation and require clones (or at least
into_vec
andfrom_vec
patterns). That might increase confidence even further.cc: @antiguru