mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
cmJSONHelpers: Add new Bind() function
This commit is contained in:
@@ -29,6 +29,9 @@ public:
|
||||
template <typename M, typename F>
|
||||
cmJSONObjectHelper& Bind(const cm::string_view& name, std::nullptr_t, F func,
|
||||
bool required = true);
|
||||
template <typename F>
|
||||
cmJSONObjectHelper& Bind(const cm::string_view& name, F func,
|
||||
bool required = true);
|
||||
|
||||
E operator()(T& out, const Json::Value* value) const;
|
||||
|
||||
@@ -86,6 +89,14 @@ cmJSONObjectHelper<T, E>& cmJSONObjectHelper<T, E>::Bind(
|
||||
required);
|
||||
}
|
||||
|
||||
template <typename T, typename E>
|
||||
template <typename F>
|
||||
cmJSONObjectHelper<T, E>& cmJSONObjectHelper<T, E>::Bind(
|
||||
const cm::string_view& name, F func, bool required)
|
||||
{
|
||||
return this->BindPrivate(name, MemberFunction(func), required);
|
||||
}
|
||||
|
||||
template <typename T, typename E>
|
||||
cmJSONObjectHelper<T, E>& cmJSONObjectHelper<T, E>::BindPrivate(
|
||||
const cm::string_view& name, MemberFunction&& func, bool required)
|
||||
|
||||
Reference in New Issue
Block a user