Skip to content

Instantly share code, notes, and snippets.

@Irfy
Created October 5, 2017 10:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Irfy/6da0f8b11e95c9c05a12e572e1a0b4bc to your computer and use it in GitHub Desktop.
Save Irfy/6da0f8b11e95c9c05a12e572e1a0b4bc to your computer and use it in GitHub Desktop.
$ cat x.cc
#include<type_traits>
#include<utility>
using namespace std;
struct T {
T() = default;
T(const T&) {}
};
static_assert(is_move_constructible<T>(), "");
T a;
T b(move(a)); // nope, no compiler error here
int main() {return 0;}
$ for gxx in /usr/local/gcc-[67]*/bin/g++; do $gxx -v |& grep version; $gxx -std=c++11 -Wall -Wextra x.cc -o x; ./x; done
gcc version 6.1.0 (GCC)
gcc version 7.1.0 (GCC)
gcc version 7.2.0 (GCC)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment