Skip to content

Cpp20 part2#229

Merged
ahcorde merged 3 commits into
rollingfrom
ahcorde/rolling/cpp20_part2
Jul 7, 2026
Merged

Cpp20 part2#229
ahcorde merged 3 commits into
rollingfrom
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

ahcorde added 2 commits June 12, 2026 10:58
Signed-off-by: Alejandro Hernandez Cordero <ahcorde@gmail.com>
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

Signed-off-by: Alejandro Hernandez Cordero <ahcorde@gmail.com>
Base automatically changed from ahcorde/rolling/cpp20 to rolling July 3, 2026 07:31
@ahcorde
ahcorde requested a review from asymingt July 3, 2026 07:32
@ahcorde

ahcorde commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

Pulls: #229
Gist: https://gist.githubusercontent.com/ahcorde/e99b83fcbb0db9a426bf4f0a588e1225/raw/2417f0f065aaee45be6c31f2131cc3d0bbed33f0/ros2.repos
BUILD args: --packages-above-and-dependencies class_loader
TEST args: --packages-above class_loader
ROS Distro: rolling
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/19719

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Linux-rhel Build Status
  • Windows Build Status

@ahcorde
ahcorde merged commit c1d6e90 into rolling Jul 7, 2026
5 checks passed
@ahcorde
ahcorde deleted the ahcorde/rolling/cpp20_part2 branch July 7, 2026 07:55
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