Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GetDestructor method #330

Closed
wants to merge 1 commit into from
Closed

Conversation

BUYT-1
Copy link
Collaborator

@BUYT-1 BUYT-1 commented Dec 19, 2023

Provides a more convenient way to destruct an object, used in #327, and perhaps it should be used in TypedColumnData too.

@BUYT-1 BUYT-1 force-pushed the get-destructor branch 2 times, most recently from 4c80f12 to 7e8607d Compare December 19, 2023 21:18
Copy link
Collaborator

@polyntsov polyntsov left a comment

Choose a reason for hiding this comment

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

Also, please, make the commit message a bit more specific

Comment on lines 132 to 134
virtual Destructor GetDestructor() const {
return nullptr;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why not make a virtual Desturct method with an empty body in the base class? Given that some types have non-trivial destruction logic and already have method Destruct adding GetDestructor seems a bit excessive. Also, the problem with GetDestructor is a default behavior in the base class, I don't think returning nullptr is a good idea, because call to nullptr will fail.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I thought it would make sense to check if the type was trivially destructible to avoid pointless calls. Checking for nullptr does just that

@BUYT-1
Copy link
Collaborator Author

BUYT-1 commented Dec 23, 2023

Nevermind, let's just use #285
~TypedColumnData uses this type info, but a pointer needs to be created for virtual methods to work, which may throw

@BUYT-1 BUYT-1 closed this Dec 23, 2023
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.

2 participants