Introduction of dynamic_as#6
Conversation
Signed-off-by: igorosky <igor.zaworski2@gmail.com>
There was a problem hiding this comment.
Pull request overview
Adds a new dynamic_as helper to perform runtime-checked downcasts across raw pointers and smart pointers, plus introduces type traits and tests to validate the behavior.
Changes:
- Added
scorpio_utils::dynamic_as<To>(from)supportingunique_ptr,shared_ptr, and raw pointers with assertion on failed casts. - Introduced
IsUniquePtr/IsSharedPtrtype traits to detect smart pointer types and polymorphism. - Added a new GoogleTest file covering success/failure paths and wired it into CMake.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 9 comments.
| File | Description |
|---|---|
| test/test_misc.cpp | Adds unit tests for dynamic_as across pointer categories. |
| include/scorpio_utils/type_traits.hpp | Introduces smart pointer detection traits used by dynamic_as. |
| include/scorpio_utils/misc.hpp | Implements dynamic_as and hooks it up to existing assert infrastructure. |
| CMakeLists.txt | Registers the new test file in the test target. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: igorosky <igor.zaworski2@gmail.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: igorosky <igor.zaworski2@gmail.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: igorosky <igor.zaworski2@gmail.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: igorosky <igor.zaworski2@gmail.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: igorosky <igor.zaworski2@gmail.com>
No description provided.