From ff8220e0e6b9f3adb108ec20c0330fc19ed2851a Mon Sep 17 00:00:00 2001 From: liuzicheng1987 Date: Sat, 18 Nov 2023 22:56:39 +0100 Subject: [PATCH] Update composing_validators.md --- docs/composing_validators.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/composing_validators.md b/docs/composing_validators.md index 43fe0366..33a348b3 100644 --- a/docs/composing_validators.md +++ b/docs/composing_validators.md @@ -19,6 +19,15 @@ struct Person { }; ``` +However, if you pass more than one constraint to `rfl::Validator`, they will be automatically connected using `rfl::AllOf`, +so you might as well write: + +```cpp +using Age = rfl::Validator, rfl::Maximum<130>>; + +... +``` + You can also nest composed validators. For instance, in this case the age must either be 0-10 or 40-130. ```cpp