Add BigNum to stringBuilder output operator.
GitOrigin-RevId: 6ba1beeccb1849a163e3e0cfc978d573f80a9dae
This commit is contained in:
parent
f92e25fcd9
commit
6c1408565e
@ -254,5 +254,9 @@ int BigNum::compare(const BigNum &a, const BigNum &b) {
|
||||
return BN_cmp(a.impl_->big_num, b.impl_->big_num);
|
||||
}
|
||||
|
||||
StringBuilder &operator<<(StringBuilder &sb, const BigNum &bn) {
|
||||
return sb << bn.to_decimal();
|
||||
}
|
||||
|
||||
} // namespace td
|
||||
#endif
|
||||
|
@ -12,6 +12,7 @@
|
||||
|
||||
#include "td/utils/Slice.h"
|
||||
#include "td/utils/Status.h"
|
||||
#include "td/utils/StringBuilder.h"
|
||||
|
||||
namespace td {
|
||||
|
||||
@ -106,6 +107,8 @@ class BigNum {
|
||||
explicit BigNum(unique_ptr<Impl> &&impl);
|
||||
};
|
||||
|
||||
StringBuilder &operator<<(StringBuilder &sb, const BigNum &bn);
|
||||
|
||||
} // namespace td
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user