Skip to content

Introduction of dynamic_as#6

Merged
igorosky merged 6 commits into
masterfrom
feature/dynamic_as
Mar 22, 2026
Merged

Introduction of dynamic_as#6
igorosky merged 6 commits into
masterfrom
feature/dynamic_as

Conversation

@igorosky
Copy link
Copy Markdown
Contributor

No description provided.

Signed-off-by: igorosky <igor.zaworski2@gmail.com>
@igorosky igorosky requested a review from Copilot March 21, 2026 15:54
@igorosky igorosky self-assigned this Mar 21, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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) supporting unique_ptr, shared_ptr, and raw pointers with assertion on failed casts.
  • Introduced IsUniquePtr / IsSharedPtr type 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.

Comment thread include/scorpio_utils/misc.hpp
Comment thread include/scorpio_utils/misc.hpp Outdated
Comment thread include/scorpio_utils/misc.hpp Outdated
Comment thread include/scorpio_utils/type_traits.hpp Outdated
Comment thread test/test_misc.cpp Outdated
Comment thread test/test_misc.cpp Outdated
Comment thread test/test_misc.cpp Outdated
Comment thread test/test_misc.cpp Outdated
Comment thread test/test_misc.cpp Outdated
Signed-off-by: igorosky <igor.zaworski2@gmail.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

Comment thread include/scorpio_utils/misc.hpp Outdated
Comment thread include/scorpio_utils/misc.hpp
Comment thread include/scorpio_utils/misc.hpp Outdated
Comment thread test/test_misc.cpp
Signed-off-by: igorosky <igor.zaworski2@gmail.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

Comment thread include/scorpio_utils/misc.hpp Outdated
Comment thread include/scorpio_utils/misc.hpp Outdated
Comment thread include/scorpio_utils/misc.hpp Outdated
Comment thread include/scorpio_utils/type_traits.hpp
Signed-off-by: igorosky <igor.zaworski2@gmail.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

Comment thread include/scorpio_utils/misc.hpp Outdated
Comment thread include/scorpio_utils/misc.hpp
@igorosky igorosky requested a review from baervevo March 21, 2026 17:52
Copy link
Copy Markdown
Contributor

@baervevo baervevo left a comment

Choose a reason for hiding this comment

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

LGTM

Signed-off-by: igorosky <igor.zaworski2@gmail.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

Comment thread include/scorpio_utils/misc.hpp
Comment thread include/scorpio_utils/misc.hpp
Signed-off-by: igorosky <igor.zaworski2@gmail.com>
Copy link
Copy Markdown
Contributor

@baervevo baervevo left a comment

Choose a reason for hiding this comment

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

LGTM

@igorosky igorosky merged commit 64c7e1c into master Mar 22, 2026
2 checks passed
@igorosky igorosky deleted the feature/dynamic_as branch March 22, 2026 20:22
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