Skip to content

Commit 89c009e

Browse files
committed
Checkpoint with copied visitor
1 parent bb1be1d commit 89c009e

File tree

1 file changed

+4
-21
lines changed

1 file changed

+4
-21
lines changed

src/mtconnect/entity/data_set.hpp

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -51,19 +51,9 @@ namespace mtconnect::entity {
5151
/// @brief the other value to compare
5252
const T &m_other;
5353
};
54-
55-
/// @brief compares two cell values
56-
/// @param other the other cell value to compare
57-
template<typename T>
58-
struct SameValue {
59-
bool operator()(const T &v1, const T &v2)
60-
{
61-
return std::visit(SameValueVisitor<T>(v1), v2);
62-
}
63-
};
64-
54+
6555
/// @brief One entry in a data set. Has necessary interface to be work with maps.
66-
template<typename T, typename SV = SameValue<T>>
56+
template<typename T, typename SV = SameValueVisitor<T>>
6757
struct Entry
6858
{
6959
/// @brief Create an entry with a key and value
@@ -114,7 +104,7 @@ namespace mtconnect::entity {
114104
bool sameValue(const Entry &other) const
115105
{
116106
const auto &ov = other.m_value;
117-
return SV()(m_value, ov);
107+
return std::visit(SV(m_value), ov);
118108
}
119109

120110
/// @brief compare a data entry ewith another
@@ -229,15 +219,8 @@ namespace mtconnect::entity {
229219

230220
};
231221

232-
struct DataSetEntrySame {
233-
bool operator ()(const DataSetValue &v1, const DataSetValue &v2) const
234-
{
235-
return std::visit(DataSetValueSameVisitor(v1), v2);
236-
}
237-
};
238-
239222
/// @brief One entry in a data set. Has necessary interface to be work with maps.
240-
using DataSetEntry = data_set::Entry<DataSetValue, DataSetEntrySame>;
223+
using DataSetEntry = data_set::Entry<DataSetValue, DataSetValueSameVisitor>;
241224

242225
/// @brief A set of data set entries
243226
class DataSet : public data_set::Set<DataSetEntry>

0 commit comments

Comments
 (0)