martinzink commented on code in PR #2153:
URL: https://github.com/apache/nifi-minifi-cpp/pull/2153#discussion_r3201405076
##########
core-framework/common/include/core/PropertyDefinitionBuilder.h:
##########
@@ -27,7 +27,21 @@ namespace org::apache::nifi::minifi::core {
namespace detail {
template<typename... Types>
inline constexpr auto TypeNames = std::array<std::string_view,
sizeof...(Types)>{core::className<Types>()...};
-}
+
+template <size_t N>
+struct StringLiteral {
+ char value[N];
+ constexpr StringLiteral(const char (&str)[N]) { // NOLINT(runtime/explicit)
+ for (size_t i = 0; i < N; ++i) {
+ value[i] = str[i];
+ }
+ }
+};
+
+// A variable template that creates permanent static memory for the span to
point to
+template <StringLiteral str>
+inline constexpr auto StaticAllowedType = std::array<std::string_view,
1>{std::string_view{str.value, sizeof(str.value) - 1}};
+} // namespace detail
Review Comment:
This is required for this to work
https://github.com/apache/nifi-minifi-cpp/pull/2153/changes#diff-0404937d5b253fb100b47ee1ae38b62125eb24f0461acb2faa431d236713933bR56
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]