Update JsonNew for IReference+cleaner optionals, and better Mappers #6890
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.
This commit updates JsonUtilsNew to support winrt
Windows::Foundation::IReference<T>
as an option type, and cleans up theoptional support code by removing the optional overload on
GetValue(...)
. Instead of using an overload with a partialspecialization, we're using a constexpr if with a type trait to
determine option-type-ness.
In addition, Carlos reported an issue with deriving from
FlagMapper
(itself templated) and referring to the base type's members without
fully qualifying them. To make derivation easier,
EnumMapper
andFlagMapper
now provideBaseEnumMapper
andBaseFlagMapper
typealiases.
I've taken the opportunity to add a
winrt::hstring
conversiontrait.
Lastly, in casual use, I found out that I'd written the til::color
converter wrong: it supports color strings of length 7 (
#rrggbb
) andlength 4 (
#rgb
). I mistyped (and failed to test) support for 4-lengthcolor strings by pretending they were only 3 characters long.
References
Merged JsonUtils changes from #6004 and #6590.
PR Checklist