Пример #1
0
 friend bool operator < (const asset& a, const asset& b)
 {
    EOS_ASSERT(a.get_symbol() == b.get_symbol(), asset_type_exception, "logical operation between two different asset is not allowed");
    return std::tie(a.amount,a.get_symbol()) < std::tie(b.amount,b.get_symbol());
 }
Пример #2
0
 friend asset operator + (const asset& a, const asset& b) {
    EOS_ASSERT(a.get_symbol() == b.get_symbol(), asset_type_exception, "addition between two different asset is not allowed");
    return asset(a.amount + b.amount, a.get_symbol());
 }
Пример #3
0
 friend bool operator == (const asset& a, const asset& b)
 {
    return std::tie(a.get_symbol(), a.amount) == std::tie(b.get_symbol(), b.amount);
 }