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

Commit

Permalink
Add missing operator < for permission_level
Browse files Browse the repository at this point in the history
  • Loading branch information
conr2d committed Sep 19, 2019
1 parent eecf9a9 commit c1c1796
Showing 1 changed file with 12 additions and 0 deletions.
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

0 comments on commit c1c1796

Please sign in to comment.