-
Notifications
You must be signed in to change notification settings - Fork 10
Closed
Description
is_empty() is defined assuming a struct with std::string(s) will be all zero - which may not be true. I fixed it using template specializations. Also included in PR #9.
diff --git a/main.cpp b/main.cpp
index b1f5146..4362782 100644
--- a/main.cpp
+++ b/main.cpp
@@ -175,6 +175,21 @@ bool is_empty(T data) {
return (*mm == 0) && memcmp(mm, mm + 1, sizeof(T) - 1) == 0;
}
+template <>
+bool is_empty(license_file data) {
+ return data.enc.empty();
+}
+
+template <>
+bool is_empty(license data) {
+ return data.id.empty();
+}
+
+template <>
+bool is_empty(machine data) {
+ return data.id.empty();
+}
+Metadata
Metadata
Assignees
Labels
No labels