Skip to content
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

Validator: implement eachElementOf(v).satisfies(predicate) #208

Merged
merged 2 commits into from
Dec 3, 2024

Conversation

JoelGunawan
Copy link
Collaborator

@JoelGunawan JoelGunawan commented Nov 26, 2024

Example usage:

public:
    void Constraints() {
        CONS(eachElementOf(A).satisfies(TestSpec::isOdd));
    }

private:
    static bool isOdd(int val) {
        return val % 2 == 1;
    }

@JoelGunawan JoelGunawan self-assigned this Nov 26, 2024
@JoelGunawan JoelGunawan changed the title Validator: implement eachElementOf(v).satisfies(predicate) Validator: implement eachElementOf(v).satisfies(predicate) Nov 26, 2024
@JoelGunawan JoelGunawan linked an issue Nov 26, 2024 that may be closed by this pull request
@JoelGunawan
Copy link
Collaborator Author

Currently eachElementOf(v).satisfies(predicate) only supports scalar types.

include/tcframe/validator/core.hpp Outdated Show resolved Hide resolved
include/tcframe/validator/core.hpp Outdated Show resolved Hide resolved
include/tcframe/validator/core.hpp Outdated Show resolved Hide resolved
include/tcframe/validator/core.hpp Outdated Show resolved Hide resolved
@fushar fushar force-pushed the refactor-vector-validator branch from f227bef to 595ef86 Compare December 3, 2024 02:06
@fushar fushar merged commit b820bdc into master Dec 3, 2024
4 checks passed
@fushar fushar deleted the refactor-vector-validator branch December 3, 2024 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Validator: implement eachElementOf(v).satisfies(predicate)
2 participants