Created
October 5, 2017 10:04
-
-
Save Irfy/6da0f8b11e95c9c05a12e572e1a0b4bc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ 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