mirror of
https://github.com/XRPLF/rippled.git
synced 2026-07-30 18:40:28 +00:00
Make XRPAmount constructor explicit:
Remove the implicit conversion from int64 to XRPAmount. The motivation for this was noticing that many calls to `to_string` with an integer parameter type were calling the wrong `to_string` function. Since the calls were not prefixed with `std::`, and there is no ADL to call `std::to_string`, this was converting the int to an `XRPAmount` and calling `to_string(XRPAmount)`. Since `to_string(XRPAmount)` did the same thing as `to_string(int)` this error went undetected.
This commit is contained in:
@@ -77,7 +77,7 @@ operator<< (std::ostream& os,
|
||||
if (amount.value().native())
|
||||
{
|
||||
// measure in hundredths
|
||||
XRPAmount const c{dropsPerXRP.drops() / 100};
|
||||
auto const c = dropsPerXRP.drops() / 100;
|
||||
auto const n = amount.value().mantissa();
|
||||
if(n < c)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user