Rebased and reworked !548 (closed)
Few cleanups first. The last commit contains the meat.
Rebased and reworked !548 (closed)
Few cleanups first. The last commit contains the meat.
+1 except the return type and exception thrown from modelFeatureName
. I think that it would be good to change this still in this MR.
Function modelFeatureName
, modelFeatureFromName
refactored to NOT throw exceptions. Return type is changed, although differently.
+1. I am not a big fan of boost::optional
but it works OK here at least it is obvious from interface that value can be invalid.
What are your motivations against boost::optional
?
just personal preferences - for me it tends to complicate the API and forces you to do all this checks for ret values (and the checks and assignment in if used to compact code are counterintuitive IMHO). Still sometimes they are useful.
Do you have better proposal in mind then my code?
Not really. I was thinking about returning "unknown" from modelFeatureName
and leaving the throw in modelFeatureFromName
but your way is cleaner.
mentioned in commit d99b67a2
merged