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-07-05 13:59:39 +0300
committerJacques Lucke <jacques@blender.org>2021-07-05 14:02:16 +0300
commit24a77745a44df011b9c2e390e3129b00086b8ea6 (patch)
tree88fdd1782d8f109632755a8ef576385f012be4a8
parentfb46c047bd52faa735a772180af3786f4228f36c (diff)
Functions: add utility to create string from value of generic type
-rw-r--r--source/blender/functions/FN_cpp_type.hh7
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/functions/FN_cpp_type.hh b/source/blender/functions/FN_cpp_type.hh
index 4de0533a46d..421e5f0018d 100644
--- a/source/blender/functions/FN_cpp_type.hh
+++ b/source/blender/functions/FN_cpp_type.hh
@@ -545,6 +545,13 @@ class CPPType : NonCopyable, NonMovable {
m_.print(value, ss);
}
+ std::string to_string(const void *value) const
+ {
+ std::stringstream ss;
+ this->print(value, ss);
+ return ss.str();
+ }
+
void print_or_default(const void *value, std::stringstream &ss, StringRef default_value) const
{
if (this->is_printable()) {