From 954c3ada00058b41d18e37b250b1db0ab9a0c93f Mon Sep 17 00:00:00 2001 From: rejuce Date: Tue, 9 Jul 2019 12:24:23 +0200 Subject: [PATCH] behaviour of get_array_of.value_or(5) i was surprise of the behaviour when calling value_or(x) on the option returned by get array of method. added to the explaination that a 0 vector of lengh supplied to value or is initialised --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 902be51..9fdd9b0 100644 --- a/README.md +++ b/README.md @@ -195,6 +195,9 @@ for (const auto& val : *vals) the key does not exist, is not of the array type, or contains values that are not of type `T`. +If the key does not exist and the method is called with `value_or` function on the returned empty `option`, the containing vector type is zero intialised to the length supplied to `value_or`. + + For nested arrays, it looks like the following: ```cpp