File tree Expand file tree Collapse file tree
modules/core/util/include Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -52,15 +52,14 @@ template <typename T>
5252constexpr std::string_view GetNamespace () {
5353#ifdef _MSC_VER
5454 constexpr std::string_view kFunc {__FUNCSIG__};
55- constexpr std::string_view key = " GetNamespace<" ;
55+ constexpr std::string_view kKey = " GetNamespace<" ;
5656#else
5757 constexpr std::string_view kFunc {__PRETTY_FUNCTION__};
58- constexpr std::string_view key = " T = " ;
58+ constexpr std::string_view kKey = " T = " ;
5959#endif
6060
61- auto start = kFunc .find (key);
62- if (start == std::string_view::npos) return {};
63- start += key.size ();
61+ auto start = kFunc .find (kKey );
62+ start = (start == std::string_view::npos) ? kFunc .size () : start + kKey .size ();
6463
6564 for (auto p : {" class " , " struct " , " enum " , " union " })
6665 if (kFunc .substr (start).starts_with (p)) start += std::string_view{p}.size ();
@@ -70,7 +69,6 @@ constexpr std::string_view GetNamespace() {
7069 return (pos != std::string_view::npos) ? ns_type.substr (0 , pos) : std::string_view{};
7170}
7271
73-
7472inline std::shared_ptr<nlohmann::json> InitJSONPtr () { return std::make_shared<nlohmann::json>(); }
7573
7674bool IsUnderMpirun ();
You can’t perform that action at this time.
0 commit comments