Added the ability for custom Include and Exclude UDAs. If multiple UDAs are given the last applies (with exception).#3
Open
JonathanILevi wants to merge 3 commits intoKripth:masterfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 2 2
Lines 139 193 +54
=====================================
+ Hits 139 193 +54
Continue to review full report at Codecov.
|
Because code coverage reports do not necessarily understand CTFE.
857730f to
b62c480
Compare
Owner
|
Thank you again for the contribution. Just one thing, can you update the readme with the new functionalities? |
Contributor
Author
|
I refactored |
Contributor
Author
|
@Kripth I can do that, though, I realized that I think I should rework the current handling of stacked groups. enum GroupA;
enum GroupB;
struct Test {
@Exclude: // Exlcude everything by default
@GroupA @GroupB ubyte c; // included in both
}
assert(Group!(Includer!GroupA,Excluder!GroupB).serialize(Test(1,2,3))==[1]); // Group A without any B
assert(Group!(Includer!GroupB,Excluder!GroupA).serialize(Test(1,2,3))==[2,3]); // All of B even c because B is given after A for c;Stacked groups should not look at the last group UDA given to the value but look at the order given in the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I added some feature I need of a project of mine. I hope you will accept them up stream.
You can now give custom Include or Exclude UDAs:
The last of stacked UDAs is used (with exception to @DecodeOnly and @EncodeOnly):