This repository was archived by the owner on Apr 19, 2023. It is now read-only.

Description
ubuntu 16.04
~/cpp_starter_project$ g++ main.cpp
main.cpp: In function ‘int main()’:
main.cpp:6:4: warning: lambda capture initializers only available with -std=c++14 or -std=gnu++14
out = std::ref(std::cout << "Hello ") { out.get() << "World\n"; }
^
main.cpp:6:10: error: ‘ref’ is not a member of ‘std’
out = std::ref(std::cout << "Hello ") { out.get() << "World\n"; }
^
main.cpp: In lambda function:
main.cpp:6:47: error: ‘out’ was not declared in this scope
out = std::ref(std::cout << "Hello ") { out.get() << "World\n"; }
^
main.cpp: In function ‘int main()’:
main.cpp:6:71: warning: lambda expressions only available with -std=c++11 or -std=gnu++11
out = std::ref(std::cout << "Hello ") { out.get() << "World\n"; }
is this a version error? how could i correct.