Created
November 15, 2017 22:49
-
-
Save LegalizeAdulthood/77c08efe218aff375b2cfc1eb5b7c310 to your computer and use it in GitHub Desktop.
Compile-time JSON example
This file contains 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
constexpr auto jsv = R"({ | |
"feature-x-enabled": true, | |
"value-of-y": 1729, | |
"z-options": { | |
"a": null, | |
"b": "220 and 284", | |
"c": [ 6, 28, 496 ] | |
} | |
})"_json; | |
if constexpr (jsv["feature-x-enabled"]) { | |
// code for feature x | |
} else { | |
// code when feature x turned off | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment