[Bf-blender-cvs] [6b5edf28a30] cycles-x: Cycles X: Make string_view class available via util_string.h

Sergey Sharybin noreply at git.blender.org
Wed Sep 8 18:21:58 CEST 2021


Commit: 6b5edf28a30a552a2205405fb562fc8361cc0274
Author: Sergey Sharybin
Date:   Wed Sep 8 09:40:43 2021 +0200
Branches: cycles-x
https://developer.blender.org/rB6b5edf28a30a552a2205405fb562fc8361cc0274

Cycles X: Make string_view class available via util_string.h

Allows to develop new APIs using string_view.

The implementation comes from OIIO to avoid collisions.

Differential Revision: https://developer.blender.org/D12427

===================================================================

M	intern/cycles/util/util_string.h

===================================================================

diff --git a/intern/cycles/util/util_string.h b/intern/cycles/util/util_string.h
index 36f993b0aa6..79a0b4f38e6 100644
--- a/intern/cycles/util/util_string.h
+++ b/intern/cycles/util/util_string.h
@@ -21,6 +21,11 @@
 #include <string.h>
 #include <string>
 
+/* Use string view implementation from OIIO.
+ * Ideally, need to switch to `std::string_view`, but this first requires getting rid of using
+ * namespace OIIO as it causes symbol collision. */
+#include <OpenImageIO/string_view.h>
+
 #include "util/util_vector.h"
 
 CCL_NAMESPACE_BEGIN
@@ -31,6 +36,8 @@ using std::string;
 using std::stringstream;
 using std::to_string;
 
+using OIIO::string_view;
+
 #ifdef __GNUC__
 #  define PRINTF_ATTRIBUTE __attribute__((format(printf, 1, 2)))
 #else



More information about the Bf-blender-cvs mailing list