Skip to content

Instantly share code, notes, and snippets.

@yohhoy
Created November 25, 2014 10:39
Show Gist options
  • Save yohhoy/18dc386e7c376c0aa276 to your computer and use it in GitHub Desktop.
Save yohhoy/18dc386e7c376c0aa276 to your computer and use it in GitHub Desktop.
#include <iostream>
#include <utility>
struct X {
X() {}
X(const X&) = delete;
X(X&&) /*noexcept(false)*/ {}
};
struct Y {
Y() {}
Y(const Y&) = delete;
Y(Y&&) noexcept(true) {}
// Y(Y&&) = default;
};
int main()
{
X x; Y y;
std::cout << noexcept(X{std::move(x)});
std::cout << noexcept(Y{std::move(y)});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment