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

Help detect if I can default a move constructor #189

Closed
akrzemi1 opened this issue Nov 6, 2017 · 3 comments
Closed

Help detect if I can default a move constructor #189

akrzemi1 opened this issue Nov 6, 2017 · 3 comments

Comments

@akrzemi1
Copy link
Member

akrzemi1 commented Nov 6, 2017

The following program fails to compile on GCC 4.4 and MSVC 12:

#include <boost/config.hpp>

#if (!defined BOOST_NO_CXX11_DEFAULTED_FUNCTIONS) && (!defined BOOST_NO_CXX11_RVALUE_REFERENCES)
static_assert(true, "***");
#else
static_assert(false, "***");
#endif

struct X
{
    X(X&&) = default;
};

int main() {}

Here is a Wandbox demo: https://wandbox.org/permlink/X5m8jmU18Fvo2Y86

Boost.Config detects support for rvalue references and for defaulted functions, but defaulting a move constructor as defaulted is still a compiler error. Can we define a config macro for that?

@jzmaddock
Copy link
Collaborator

@akrzemi1
Copy link
Member Author

akrzemi1 commented Jan 4, 2018

Here we go: #205

@jzmaddock
Copy link
Collaborator

PR is merged (thanks) so closing down...

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

2 participants