diff --git a/include/snapshot/snapshot.h b/include/snapshot/snapshot.h index 7c4614b..249a82e 100644 --- a/include/snapshot/snapshot.h +++ b/include/snapshot/snapshot.h @@ -455,6 +455,7 @@ class Snapshot { template static void GenerateSnapshotDiff(const T& before, const T& after, const char* file_name, const char* func_name, const int line_number, const std::vector& custom_keys = std::vector({})) { + func_name = fixFuncName(func_name); const auto filename_split = StringUtility::Split(file_name, '/'); const auto snapshot_key = getSnapshotKey(file_name, func_name, line_number, custom_keys); const auto snapshot_filename = getSnapshotDiffFilename(filename_split.back()); @@ -502,6 +503,14 @@ class Snapshot { } private: + static const char* fixFuncName(const char* func_name) { + if (strcmp(func_name, "operator()") == 0) { + return "operator"; + } + + return func_name; + } + static std::pair getSnapshotInlineMatchRange(const std::string& s) { const std::string prefix = "SNAPSHOT_INLINE(";