Language
C++
Compiler
gcc 7.2.0
Options
Warnings
Don't Use Boost
C++11
no pedantic
#include <iostream>
#include <algorithm>
#include <vector>
#include <memory>
#include <iostream>
#include <functional>
#include <type_traits>
int main()
{
int const x = 10;
auto foo = [x] () mutable {
std::cout << std::is_const<decltype(x)>::value << std::endl;
x = 11;
};
foo();
// remove_reference_t<decltype(x)> x = x;
}
$ g++ prog.cc -Wall -Wextra -std=c++11
Exit Code:
1