diff options
author | Kyle Edwards <kyle.edwards@kitware.com> | 2020-09-23 12:50:52 (GMT) |
---|---|---|
committer | Kyle Edwards <kyle.edwards@kitware.com> | 2020-10-05 13:49:59 (GMT) |
commit | 3059e6aed7ac3e773dd1f184558b9fd8a4b7b11e (patch) | |
tree | 07d066ec261fd9b45d09adafe0d1371c4276a365 /Source | |
parent | 8682d1b7b262258b779cba66a0e6e76f6617d588 (diff) | |
download | CMake-3059e6aed7ac3e773dd1f184558b9fd8a4b7b11e.zip CMake-3059e6aed7ac3e773dd1f184558b9fd8a4b7b11e.tar.gz CMake-3059e6aed7ac3e773dd1f184558b9fd8a4b7b11e.tar.bz2 |
cmJSONHelpers: Add new Bind() function
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmJSONHelpers.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Source/cmJSONHelpers.h b/Source/cmJSONHelpers.h index 2da2a03..a63347d 100644 --- a/Source/cmJSONHelpers.h +++ b/Source/cmJSONHelpers.h @@ -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; @@ -87,6 +90,14 @@ cmJSONObjectHelper<T, E>& cmJSONObjectHelper<T, E>::Bind( } 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) { |