0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-29 10:12:39 +01:00

ircd::json: Additional initializer list convenience constructors for keys.

This commit is contained in:
Jason Volk 2018-05-19 21:19:47 -07:00
parent 16c86f9a76
commit d30aa971e5

View file

@ -36,7 +36,7 @@ struct ircd::json::keys
operator vector_view<const string_view>() const;
keys(const selection &);
explicit keys(const selection &);
keys();
};
@ -70,6 +70,10 @@ struct ircd::json::keys<tuple>::include
for(const auto &key : list)
this->set(indexof<tuple>(key), true);
}
include(const std::initializer_list<const string_view> &list)
:include(vector_view<const string_view>(list))
{}
};
/// Construct this class with a list of keys you want to deselect for a given
@ -85,6 +89,10 @@ struct ircd::json::keys<tuple>::exclude
for(const auto &key : list)
this->set(indexof<tuple>(key), false);
}
exclude(const std::initializer_list<const string_view> &list)
:exclude(vector_view<const string_view>(list))
{}
};
//