Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2021-09-22 20:55:44 +0300
committerJacques Lucke <jacques@blender.org>2021-09-22 20:55:44 +0300
commitf893dea5863934e5c09cff673ff6cccd4106e069 (patch)
treebed24e3bf6124713c528052c1898087d13d4f2d8 /source/blender/blenlib/tests
parent02bde2c1d5bbf1ea44209a618eb1947ea1d6cd25 (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/tests')
-rw-r--r--source/blender/blenlib/tests/BLI_function_ref_test.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/blenlib/tests/BLI_function_ref_test.cc b/source/blender/blenlib/tests/BLI_function_ref_test.cc
index 74f5014142c..20c9ee5885e 100644
--- a/source/blender/blenlib/tests/BLI_function_ref_test.cc
+++ b/source/blender/blenlib/tests/BLI_function_ref_test.cc
@@ -124,4 +124,10 @@ TEST(function_ref, CallSafeVoid)
EXPECT_EQ(value, 1);
}
+TEST(function_ref, InitializeWithNull)
+{
+ FunctionRef<int(int, int)> f{nullptr};
+ EXPECT_FALSE(f);
+}
+
} // namespace blender::tests