diff options
author | Jacques Lucke <jacques@blender.org> | 2021-09-22 20:55:44 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2021-09-22 20:55:44 +0300 |
commit | f893dea5863934e5c09cff673ff6cccd4106e069 (patch) | |
tree | bed24e3bf6124713c528052c1898087d13d4f2d8 /source/blender/blenlib/BLI_function_ref.hh | |
parent | 02bde2c1d5bbf1ea44209a618eb1947ea1d6cd25 (diff) |
BLI: support initializing empty FunctionRef with nullptr
This may sometimes be desired because it is more explicitely
shows that the `FunctionRef` will be empty.
Diffstat (limited to 'source/blender/blenlib/BLI_function_ref.hh')
-rw-r--r-- | source/blender/blenlib/BLI_function_ref.hh | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_function_ref.hh b/source/blender/blenlib/BLI_function_ref.hh index 70a064adc5d..71be7d7f029 100644 --- a/source/blender/blenlib/BLI_function_ref.hh +++ b/source/blender/blenlib/BLI_function_ref.hh @@ -110,6 +110,10 @@ template<typename Ret, typename... Params> class FunctionRef<Ret(Params...)> { public: FunctionRef() = default; + FunctionRef(std::nullptr_t) + { + } + /** * A `FunctionRef` itself is a callable as well. However, we don't want that this * constructor is called when `Callable` is a `FunctionRef`. If we would allow this, it |