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

Add missing operator < for permission_level #656

Merged
merged 1 commit into from
Sep 27, 2019
Merged
Changes from all commits
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
12 changes: 12 additions & 0 deletions libraries/eosiolib/contracts/eosio/action.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,18 @@ namespace eosio {
return std::tie( a.actor, a.permission ) == std::tie( b.actor, b.permission );
}

/**
* Lexicographically compares two permissions
*
* @param a - first permission to compare
* @param b - second permission to compare
* @return true if a < b
* @return false if a >= b
*/
friend constexpr bool operator < ( const permission_level& a, const permission_level& b ) {
return std::tie( a.actor, a.permission ) < std::tie( b.actor, b.permission );
}

EOSLIB_SERIALIZE( permission_level, (actor)(permission) )
};

Expand Down