Skip to content

Cpp20 part2#229

Open
ahcorde wants to merge 1 commit into
ahcorde/rolling/cpp20from
ahcorde/rolling/cpp20_part2
Open

Cpp20 part2#229
ahcorde wants to merge 1 commit into
ahcorde/rolling/cpp20from
ahcorde/rolling/cpp20_part2

Conversation

@ahcorde

@ahcorde ahcorde commented Jun 12, 2026

Copy link
Copy Markdown
Contributor
  • Lambda over std::bind
  • typedef→using in the two headers
  • [[nodiscard]] on the factories and pure queries of both ClassLoader and MultiLibraryClassLoader

@asymingt FYI

Claude Opus 4.7

Signed-off-by: Alejandro Hernandez Cordero <ahcorde@gmail.com>
@ahcorde ahcorde self-assigned this Jun 12, 2026
@pum1k

pum1k commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

The [[nodiscard]] causes warnings when compiling tests. Maybe explicitly ignore the result in those cases?

diff --git a/test/unique_ptr_test.cpp b/test/unique_ptr_test.cpp
index eb9f8a1..c2a6f7b 100644
--- a/test/unique_ptr_test.cpp
+++ b/test/unique_ptr_test.cpp
@@ -119,7 +119,8 @@ TEST(ClassLoaderUniquePtrTest, basicLoadFailures) {
 TEST(ClassLoaderUniquePtrTest, MultiLibraryClassLoaderFailures) {
   class_loader::MultiLibraryClassLoader loader(true);
   loader.loadLibrary(LIBRARY_1);
-  EXPECT_THROW(loader.createUniqueInstance<Base>("Cat2"), class_loader::ClassLoaderException);
+  EXPECT_THROW(std::ignore = loader.createUniqueInstance<Base>("Cat2"),
+    class_loader::ClassLoaderException);
 }
 
 TEST(ClassLoaderUniquePtrTest, LibrariesUsedByClassLoader) {
diff --git a/test/utest.cpp b/test/utest.cpp
index 2870f6b..754ee4a 100644
--- a/test/utest.cpp
+++ b/test/utest.cpp
@@ -163,7 +163,8 @@ TEST(ClassLoaderUniquePtrTest, basicLoadFailures) {
 TEST(ClassLoaderUniquePtrTest, MultiLibraryClassLoaderFailures) {
   class_loader::MultiLibraryClassLoader loader(true);
   loader.loadLibrary(LIBRARY_1);
-  EXPECT_THROW(loader.createUniqueInstance<Base>("Cat2"), class_loader::ClassLoaderException);
+  EXPECT_THROW(std::ignore = loader.createUniqueInstance<Base>("Cat2"),
+    class_loader::ClassLoaderException);
 }
 
 TEST(ClassLoaderTest, correctNonLazyLoadUnload) {

@asymingt asymingt left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[[nodiscard]] is so pedantic. I don't really think its required in the places you added it, but I also think it isn't harmful adding it. Please add the change requested from @pum1k before merging.

@mergify

mergify Bot commented Jun 26, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants