Fix clang errors
- structs used in emplace_back now have defined constructor
- removed dead code from ensure
Testing done:
- CI tests are passing
- UTs are passing
Signed-off-by: Szymon Dompke <szymon.dompke@intel.com>
Change-Id: I3f56a3796e45d608c7a5d3da1f8c2d674d62f567
diff --git a/src/metric_value.hpp b/src/metric_value.hpp
index d01ac4e..6c1d3da 100644
--- a/src/metric_value.hpp
+++ b/src/metric_value.hpp
@@ -9,4 +9,10 @@
std::string metadata;
double value;
uint64_t timestamp;
+
+ MetricValue(std::string_view idIn, std::string_view metadataIn,
+ double valueIn, uint64_t timestampIn) :
+ id(idIn),
+ metadata(metadataIn), value(valueIn), timestamp(timestampIn)
+ {}
};
diff --git a/src/types/error_message.hpp b/src/types/error_message.hpp
index de27772..c40d1f8 100644
--- a/src/types/error_message.hpp
+++ b/src/types/error_message.hpp
@@ -8,4 +8,8 @@
{
ErrorType error;
std::string arg0;
+
+ ErrorMessage(ErrorType errorIn, std::string_view arg0In) :
+ error(errorIn), arg0(arg0In)
+ {}
};
diff --git a/src/utils/ensure.hpp b/src/utils/ensure.hpp
index 8f266ab..8c4fc99 100644
--- a/src/utils/ensure.hpp
+++ b/src/utils/ensure.hpp
@@ -18,11 +18,7 @@
Ensure(F functor) : functor(std::move(functor))
{}
- Ensure(Ensure&& other) : functor(std::move(other.functor))
- {
- other.functor = std::nullopt;
- }
-
+ Ensure(Ensure&& other) = delete;
Ensure(const Ensure&) = delete;
~Ensure()
@@ -38,12 +34,7 @@
return *this;
}
- Ensure& operator=(Ensure&& other)
- {
- clear();
- std::swap(functor, other.functor);
- return *this;
- }
+ Ensure& operator=(Ensure&& other) = delete;
Ensure& operator=(std::nullptr_t)
{