mirror of
https://github.com/dashpay/dash.git
synced 2024-12-24 19:42:46 +01:00
fix: add cast to void to avoid gcc warning inside string_cast.cpp
It fixes this warning: ``` bench/string_cast.cpp:85:84: warning: ignoring return value of ‘std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&) [with _CharT = char; _Traits = char_traits<char>; _Alloc = allocator<char>]’, declared with attribute ‘nodiscard’ [-Wunused-result] ```
This commit is contained in:
parent
0c26093915
commit
66432fd04e
@ -59,12 +59,12 @@ static void strings_1_tostring(benchmark::Bench& bench)
|
||||
static void strings_2_multi_lexical_cast(benchmark::Bench& bench)
|
||||
{
|
||||
int i{0};
|
||||
bench.run([&] {
|
||||
bench.run([&] { static_cast<void>(
|
||||
boost::lexical_cast<std::string>(i) +
|
||||
boost::lexical_cast<std::string>(i+1) +
|
||||
boost::lexical_cast<std::string>(i+2) +
|
||||
boost::lexical_cast<std::string>(i+3) +
|
||||
boost::lexical_cast<std::string>(i+4);
|
||||
boost::lexical_cast<std::string>(i+4));
|
||||
++i;
|
||||
});
|
||||
}
|
||||
@ -72,8 +72,8 @@ static void strings_2_multi_lexical_cast(benchmark::Bench& bench)
|
||||
static void strings_2_multi_numberToString(benchmark::Bench& bench)
|
||||
{
|
||||
int i{0};
|
||||
bench.run([&] {
|
||||
NumberToString(i) + NumberToString(i+1) + NumberToString(i+2) + NumberToString(i+3) + NumberToString(i+4);
|
||||
bench.run([&] { static_cast<void>(
|
||||
NumberToString(i) + NumberToString(i+1) + NumberToString(i+2) + NumberToString(i+3) + NumberToString(i+4));
|
||||
++i;
|
||||
});
|
||||
}
|
||||
@ -81,8 +81,8 @@ static void strings_2_multi_numberToString(benchmark::Bench& bench)
|
||||
static void strings_2_multi_tostring(benchmark::Bench& bench)
|
||||
{
|
||||
int i{0};
|
||||
bench.run([&] {
|
||||
ToString(i) + ToString(i+1) + ToString(i+2) + ToString(i+3) + ToString(i+4);
|
||||
bench.run([&] { static_cast<void>(
|
||||
ToString(i) + ToString(i+1) + ToString(i+2) + ToString(i+3) + ToString(i+4));
|
||||
++i;
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user