diff options
author | Jacques Lucke <jacques@blender.org> | 2021-07-05 13:59:39 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2021-07-05 14:02:16 +0300 |
commit | 24a77745a44df011b9c2e390e3129b00086b8ea6 (patch) | |
tree | 88fdd1782d8f109632755a8ef576385f012be4a8 /source/blender/functions/FN_cpp_type.hh | |
parent | fb46c047bd52faa735a772180af3786f4228f36c (diff) |
Functions: add utility to create string from value of generic type
Diffstat (limited to 'source/blender/functions/FN_cpp_type.hh')
-rw-r--r-- | source/blender/functions/FN_cpp_type.hh | 7 |
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()) { |