1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-30 03:23:16 +02:00

Create nlohmann serializers for std::optional and use

This is somewhat tricky.
This commit is contained in:
John Ericson 2023-06-16 15:19:14 -04:00
parent 3b0d8fd796
commit c8825e9d8c
4 changed files with 97 additions and 25 deletions

View file

@ -3,7 +3,7 @@
#include "comparator.hh"
#include "error.hh"
#include "nlohmann/json_fwd.hpp"
#include "json-utils.hh"
#include "types.hh"
namespace nix {
@ -93,4 +93,10 @@ public:
void to_json(nlohmann::json &, const ExperimentalFeature &);
void from_json(const nlohmann::json &, ExperimentalFeature &);
/**
* It is always rendered as a string
*/
template<>
struct json_avoids_null<ExperimentalFeature> : std::true_type {};
}