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

four slow moves #342

Open
dcb314 opened this issue Aug 23, 2022 · 0 comments
Open

four slow moves #342

dcb314 opened this issue Aug 23, 2022 · 0 comments

Comments

@dcb314
Copy link

dcb314 commented Aug 23, 2022

Recent development versions of gcc can be made to say:

src/rttr/../rttr/detail/registration/bind_impl.h:201:67: warning: moving a temporary object prevents copy elision [-Wpessimizing-move]

Source code is

        m_ctor = create_constructor_wrapper<first_prop_policy>(std::move(get_metadata(std::forward<Args>(args)...)),
                                                               std::move(get_default_args<type_list<Ctor_Args...>, constructor_type>(std::forward<Args>(args)...)),
                                                               std::move(create_param_infos<type_list<Ctor_Args...>, constructor_type>(std::forward<Args>(args)...)));

More of the same at:

detail/registration/bind_impl.h:427:44: warning: moving a temporary object prevents copy elision [-Wpessimizing-move]
detail/registration/bind_impl.h:609:44: warning: moving a temporary object prevents copy elision [-Wpess
imizing-move]
detail/registration/bind_impl.h:520:44: warning: moving a temporary object prevents copy elision [-Wpess
imizing-move]

A bit of code rewrite would have the code running faster, especially the first one.
There are 108 cases of that.

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

No branches or pull requests

1 participant