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

Allowing for non-default-constructible component types #2851

Merged
merged 1 commit into from Aug 22, 2017
Merged

Conversation

hkaiser
Copy link
Member

@hkaiser hkaiser commented Aug 20, 2017

@krivenko: please verify this solves the problem you reported the other day,

@krivenko
Copy link

@hkaiser
The new_2848 test compiles and passes.
My application code compiles as well with default constructors removed from components.
Thanks a lot!

naming::gid_type create(std::size_t count, std::false_type)
{
// shouldn't ever be called for non-default-constructible types
HPX_ASSERT(false);
Copy link
Member

Choose a reason for hiding this comment

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

Why do we have to resort to a runtime error here?

Copy link
Member Author

Choose a reason for hiding this comment

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

What do you suggest? A static assert would trigger for any non-default constructible type.

Copy link
Member

Choose a reason for hiding this comment

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

Only if we call new_ without arguments, no?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, always - this function is called by create(size_t) which is a virtual function.

Copy link
Member

Choose a reason for hiding this comment

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

ah, right, too bad :/

naming::gid_type create(std::size_t count, std::false_type)
{
// shouldn't ever be called for non-default-constructible types
HPX_ASSERT(false);
Copy link
Member

Choose a reason for hiding this comment

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

same as above

@hkaiser hkaiser merged commit 7f3ebe7 into master Aug 22, 2017
@hkaiser hkaiser deleted the fixing_2848 branch August 22, 2017 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Components have to be default constructible
3 participants