Hi, imagine I have:
public Int2 Degree { get; protected set; }
// My degree must be > 0
// I can't make default degree like (1,1)
// Only specify default there witch is (0,0)
public void SetDegree(Int2 degree = default)
{
// so now i can do something like
if (degree == defalut)
Degree = new Int(2,2)
// However if user creates IO Box
// he is going to pass 0,0 stright away
// so I can do something like:
Degree = new Int2(Math.Max(2,degree.X), Math.Max(2, degree.Y);
// witch is going to be nice from user
// perspective (no error), but now
// user passed one arg, and i use another arg
// Here is the question:
// What to do here, to notify user that there was an error?
// But keep execution
}
And a side note:
Is it possible somehow to specify defaults for structs, unless it’s wrapped in forward?
