-
Notifications
You must be signed in to change notification settings - Fork 371
add transformer and checkedTransformer #239
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
TODO yet:
|
Having three copies of nearly identical code bothers me, three times the maintenance and extra compile cost. Is there a way to combine and/or share bits? Having a way to "uncheck" a Validator would be useful (causing failures to be ignored). I don't think there's a good operator for it, but a method could be used maybe? |
I was going to take a look at the code duplication once I got it working completely with all the tests. I am pretty sure there are some things that can be done. |
Codecov Report
@@ Coverage Diff @@
## master #239 +/- ##
==========================================
- Coverage 100% 99.51% -0.49%
==========================================
Files 12 12
Lines 2212 2291 +79
==========================================
+ Hits 2212 2280 +68
- Misses 0 11 +11
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #239 +/- ##
======================================
Coverage 100% 100%
======================================
Files 12 12
Lines 2402 2547 +145
======================================
+ Hits 2402 2547 +145
Continue to review full report at Codecov.
|
I tried extracting out a search function, I think It is working now. I need to run through them some more to make sure they are actually working like I expect. Also tried to remove some of the copying that was going on with the smart_deref and pair_adaptor. Someone should really make sure those templates actually do what they are supposed to do. This deep of template nesting is not something I do everyday. An interesting exercise though. |
e788f22
to
d9425c3
Compare
f6f4870
to
df80011
Compare
add Transformer and CheckedTransformer validators
add tests Make Validators a full Object and remove friend, move to descriptions instead of overriding type name. update validators to actually merge the type strings and use all validators in the type outputs rework join so it works without the start variable, allow some forwarding references in the validator types, some tests for non-copyable maps, and transforms merge the search function and enable use of member search function, make the pair adapters forwarding instead of copying
fix some gcc 4.7 issues and add a few more test cases and more parts of the README Work on ReadMe and add Bound validator to clamp values
594c7bd
to
95109ab
Compare
This is the last of the PR's originating from #229.
This builds on the IsMember function and adds Transformer and CheckedTransformer validators
Modifications include disabling the IsMember validator from using the second element of a map, so maps with non-convertible types can be used. IsMember will modify the input to match an element of the set.
Validators added through the transform function are inserted at the beginning of the validators list, this allows transformations to occur before a check regardless of the order added.
Some tweaks and updates to the IsMember function to clean up some loops and remove some unnecessary processing from inside the loop.