Skip to main content
6 events
when toggle format what by license comment
Apr 10, 2018 at 6:22 vote accept Null
Feb 7, 2018 at 20:30 comment added Null tolerance_spec() indeed has a bug in which it doesn't use the clamps. I think I changed the definition of clamp() from taking the value as a reference to a const reference, which created a bug in tolerance_spec(). Good catch.
Feb 7, 2018 at 20:21 comment added Null I'm on the fence about checking for a negative tolerance since the min is allowed to be lower than the max...but I wouldn't expect users to get a Spec with min > max that way. The reason I allow min > max is that it's possible for that to happen once I add guardbands to the class and if the guardbands are high enough to invert the min/max. It's something I'll have to think about some more.
Feb 7, 2018 at 20:16 comment added Null I explicitly deleted default constructor in part for documenting the fact that users shouldn't try to construct a Spec without at least one of the minimum/typical/maximum.
Feb 7, 2018 at 20:14 comment added Null The problem with the single constructor taking three optionals is that a Spec can be constructed with no minimum/typical/maximum by calling the constructor with three optionals that don't have a value. Additionally, many specifications don't have all three parameters so it would be annoying to always have to provide nullspec arguments in those cases. While a single constructor is attractive for its simplicity, as a user of the class I've found it convenient to have additional constructors so that I don't have to use nullspec arguments in most cases.
Feb 7, 2018 at 19:01 history answered user673679 CC BY-SA 3.0