#include <algorithm>
Include this and then you can compile it using...
g++ -Wall -std=c++11 test.cpp -o test
You can also add "cd /d %~dp0" as the first line of a .bat file in the same directory as your source file so all you have to do is double click on the .bat file for an "automated" compilation.
Hope this helps!