Skip to content

Commit dc6ac67

Browse files
committed
tests: Make some casts explicit.
Noticed by clang-tidy.
1 parent ac26577 commit dc6ac67

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

tests/test_bind.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ struct foo
1818
int operator()(int i)
1919
{
2020
result_stream << "foo(int " << i << ") ";
21-
return i > 0;
21+
return static_cast<int>(i > 0);
2222
}
2323

2424
int operator()(int i, int j)

tests/test_compose.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ struct get
6161
double operator()()
6262
{
6363
result_stream << "get() ";
64-
return true;
64+
return static_cast<double>(true);
6565
}
6666

6767
double operator()(int i)

tests/test_tuple_transform_each.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ template <>
253253
class transform_as_constexpr_to_something<int>
254254
{
255255
public:
256-
constexpr static char transform(int from) { return 'a' + from; }
256+
constexpr static char transform(int from) { return 'a' + static_cast<char>(from); }
257257
};
258258

259259
// A double will be converted to an int:

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy