Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Added comparison operators for extended_symbol type #8540

Merged
merged 2 commits into from
Jan 31, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions libraries/chain/include/eosio/chain/symbol.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,25 @@ namespace eosio {
return lhs.value() > rhs.value();
}

inline bool operator== (const extended_symbol& lhs, const extended_symbol& rhs)
{
return std::tie(lhs.sym, lhs.contract) == std::tie(rhs.sym, rhs.contract);
}

inline bool operator!= (const extended_symbol& lhs, const extended_symbol& rhs)
{
return std::tie(lhs.sym, lhs.contract) != std::tie(rhs.sym, rhs.contract);
}

inline bool operator< (const extended_symbol& lhs, const extended_symbol& rhs)
{
return std::tie(lhs.sym, lhs.contract) < std::tie(rhs.sym, rhs.contract);
}

inline bool operator> (const extended_symbol& lhs, const extended_symbol& rhs)
{
return std::tie(lhs.sym, lhs.contract) > std::tie(rhs.sym, rhs.contract);
}
} // namespace chain
} // namespace eosio

Expand Down