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-02-23 13:47:01 +0300
committerJacques Lucke <jacques@blender.org>2021-02-23 13:52:06 +0300
commitaa4882506c9acb5483b506c5e1d1569ca8cf5dd3 (patch)
treebc5f8188b267e4a3caf173810d6e1778a7cc9dcd /source/blender/blenlib/CMakeLists.txt
parentb2e1b13abde787c2aad97d5c317357cf84360bdb (diff)
BLI: new FunctionRef type
Using `FunctionRef` is better than using `std::function`, templates and c function pointers in some cases. The trade offs are explained in more detail in code documentation. The following are some of the main benefits of using `FunctionRef`: * It is convenient to use with all kinds of callables. * It is cheaper to construct, copy and (possibly) call compared to `std::function`. * Functions taking a `FunctionRef` as parameter don't need to be declared in header files (as is necessary when using templates usually). Differential Revision: https://developer.blender.org/D10476
Diffstat (limited to 'source/blender/blenlib/CMakeLists.txt')
-rw-r--r--source/blender/blenlib/CMakeLists.txt2
1 files changed, 2 insertions, 0 deletions
diff --git a/source/blender/blenlib/CMakeLists.txt b/source/blender/blenlib/CMakeLists.txt
index 363d3003b3c..5a851b7b2cb 100644
--- a/source/blender/blenlib/CMakeLists.txt
+++ b/source/blender/blenlib/CMakeLists.txt
@@ -192,6 +192,7 @@ set(SRC
BLI_float3.hh
BLI_float4x4.hh
BLI_fnmatch.h
+ BLI_function_ref.hh
BLI_ghash.h
BLI_gsqueue.h
BLI_hash.h
@@ -388,6 +389,7 @@ if(WITH_GTESTS)
tests/BLI_disjoint_set_test.cc
tests/BLI_edgehash_test.cc
tests/BLI_expr_pylike_eval_test.cc
+ tests/BLI_function_ref_test.cc
tests/BLI_ghash_test.cc
tests/BLI_hash_mm2a_test.cc
tests/BLI_heap_simple_test.cc