Skip to content

Commit 85da5a4

Browse files
committed
[[maybe_unused]] -> _
1 parent 230e616 commit 85da5a4

10 files changed

Lines changed: 16 additions & 16 deletions

File tree

modules/Container/Stack.mpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export namespace CppUtils::Container
4040
inline constexpr auto push(Type::TriviallyCopyable auto value) -> void
4141
{
4242
m_data.resize(std::size(m_data) + sizeof(decltype(value)), std::byte{0});
43-
[[maybe_unused]] auto unused = set(value);
43+
auto _ = set(value);
4444
}
4545

4646
template<Type::TriviallyCopyable T>

modules/Log/Logger.mpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ export namespace CppUtils
147147
using Logger = Logger<"CppUtils">;
148148
if (depth == 0)
149149
Logger::print<"error">("{}", exception.what());
150-
[[maybe_unused]] auto textModifier = (depth == 0) ? Terminal::TextModifier{stdout, Terminal::TextColor::TextColorEnum::Red} : Terminal::TextModifier{};
150+
auto _ = (depth == 0) ? Terminal::TextModifier{stdout, Terminal::TextColor::TextColorEnum::Red} : Terminal::TextModifier{};
151151
if (depth > 0)
152152
Logger::print("{}{}\n", std::string(depth * 2, ' '), exception.what());
153153
try

modules/Terminal/TextModifier.mpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ export namespace CppUtils::Terminal
3636
m_modify{true},
3737
m_file{file}
3838
{
39-
[[maybe_unused]] auto text = TextColor::getTextColorCode(textColor);
40-
[[maybe_unused]] auto background = BackgroundColor::getBackgroundColorCode(backgroundColor);
39+
auto text = TextColor::getTextColorCode(textColor);
40+
auto background = BackgroundColor::getBackgroundColorCode(backgroundColor);
4141
#if defined(OS_WINDOWS)
4242
m_attributes = getTextColor(m_file);
4343
SetConsoleTextAttribute(getTerminalHandle(m_file), static_cast<std::uint16_t>((background << 4) + text));

modules/Type/Enum.mpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export namespace CppUtils::Type::Enum
2121
auto string = "Unknown"sv;
2222

2323
[&]<std::size_t... I>(std::index_sequence<I...>) constexpr {
24-
[[maybe_unused]] auto result = ((value == std::get<I>(Values<Enum>) and (string = Name<std::get<I>(Values<Enum>)>, true)) or ...);
24+
auto _ = ((value == std::get<I>(Values<Enum>) and (string = Name<std::get<I>(Values<Enum>)>, true)) or ...);
2525
}(std::make_index_sequence<nbValues>{});
2626

2727
return string;

modules/UnitTest/UnitTest.mpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,12 +139,12 @@ namespace CppUtils::UnitTest
139139
return exitSuccess;
140140
}
141141
{
142-
[[maybe_unused]] auto textModifier = Terminal::TextModifier{stdout, Terminal::TextColor::TextColorEnum::Red};
142+
auto _ = Terminal::TextModifier{stdout, Terminal::TextColor::TextColorEnum::Red};
143143
Logger::print("The tests failed:\n");
144144
}
145145
if (nbSuccess > 0)
146146
Logger::print<"success">("- {} successful tests", nbSuccess);
147-
[[maybe_unused]] auto textModifier = Terminal::TextModifier{stdout, Terminal::TextColor::TextColorEnum::Red};
147+
auto _ = Terminal::TextModifier{stdout, Terminal::TextColor::TextColorEnum::Red};
148148
if (nbSuccess == 0)
149149
Logger::print("- 0 successful tests\n");
150150
Logger::print("- {} failed tests\n", nbFail);

tests/Container/MeshNetwork.mpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export namespace CppUtils::UnitTest::Container::MeshNetwork
1010
using StringMeshNode = CppUtils::Container::MeshNodePtr<std::string, std::string>;
1111

1212
suite.addTest("Initialization", [&] {
13-
[[maybe_unused]] auto bananaNode = StringMeshNode::make("banana");
13+
auto _ = StringMeshNode::make("banana");
1414
});
1515

1616
suite.addTest("Access value", [&] {

tests/Container/NetworkPtr.mpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ export namespace CppUtils::UnitTest::Container::NetworkPtr
1111
using StringNetworkPtr = CppUtils::Container::NetworkPtr<std::string>;
1212

1313
suite.addTest("Create root", [&] {
14-
[[maybe_unused]] auto root = NetworkPtr::makeRoot("Root");
14+
auto _ = NetworkPtr::makeRoot("Root");
1515
});
1616

1717
suite.addTest("Create node", [&] {
18-
[[maybe_unused]] auto node = NetworkPtr::make("Node");
18+
auto _ = NetworkPtr::make("Node");
1919
});
2020

2121
suite.addTest("Read value", [&] {

tests/Execution/EventSystem.mpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export namespace CppUtils::UnitTest::Execution::EventSystem
1111
using Logger = CppUtils::Logger<"CppUtils">;
1212

1313
suite.addTest("Empty", [&] {
14-
[[maybe_unused]] auto eventSystem = CppUtils::Execution::EventSystem{};
14+
auto _ = CppUtils::Execution::EventSystem{};
1515
});
1616

1717
suite.addTest("Subscribe", [&] {

tests/Network/Network.mpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ export namespace CppUtils::UnitTest::Network
1111
using Logger = CppUtils::Logger<"CppUtils">;
1212

1313
suite.addTest("Server Creation", [&] {
14-
[[maybe_unused]] auto server = CppUtils::Network::Server{};
14+
auto _ = CppUtils::Network::Server{};
1515
});
1616

1717
suite.addTest("Client Creation", [&] {
18-
[[maybe_unused]] auto client = CppUtils::Network::Client{};
18+
auto _ = CppUtils::Network::Client{};
1919
});
2020

2121
suite.addTest("Server: Bind IP", [&] {

tests/Thread/ThreadPool.mpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ export namespace CppUtils::UnitTest::Thread::ThreadPool
77
{
88
inline auto _ = CppUtils::UnitTest::TestSuite{"Thread/ThreadPool", {"UnitTest"}, [](auto& suite) {
99
suite.addTest("0 task / 1 thread", [&] {
10-
[[maybe_unused]] auto threadPool = CppUtils::Thread::ThreadPool{1};
10+
auto _ = CppUtils::Thread::ThreadPool{1};
1111
});
1212

1313
suite.addTest("0 task / 2 threads", [&] {
14-
[[maybe_unused]] auto threadPool = CppUtils::Thread::ThreadPool{2};
14+
auto _ = CppUtils::Thread::ThreadPool{2};
1515
});
1616

1717
suite.addTest("0 task / N threads", [&] {
18-
[[maybe_unused]] auto threadPool = CppUtils::Thread::ThreadPool{};
18+
auto _ = CppUtils::Thread::ThreadPool{};
1919
});
2020

2121
suite.addTest("1 task with future.wait()", [&] {

0 commit comments

Comments
 (0)