mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-06-20 13:53:15 +02:00
util: fix compiler warning about deprecated space before _MiB
``` src/util/byte_units.h:13:29: error: identifier '_MiB' preceded by whitespace in a literal operator declaration is deprecated [-Werror,-Wdeprecated-literal-operator] 13 | constexpr size_t operator"" _MiB(unsigned long long mebibytes) | ~~~~~~~~~~~^~~~ | operator""_MiB 1 error generated. ``` Clang 20.0.0
This commit is contained in:
parent
89720b7a1b
commit
d3339a7cd5
@ -10,7 +10,7 @@
|
|||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
|
||||||
//! Overflow-safe conversion of MiB to bytes.
|
//! Overflow-safe conversion of MiB to bytes.
|
||||||
constexpr size_t operator"" _MiB(unsigned long long mebibytes)
|
constexpr size_t operator""_MiB(unsigned long long mebibytes)
|
||||||
{
|
{
|
||||||
auto bytes{CheckedLeftShift(mebibytes, 20)};
|
auto bytes{CheckedLeftShift(mebibytes, 20)};
|
||||||
if (!bytes || *bytes > std::numeric_limits<size_t>::max()) {
|
if (!bytes || *bytes > std::numeric_limits<size_t>::max()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user