Once you get the code compiled, you probably need to change this: for(auto it = x.end();it != x.begin();it++)
to this for(auto it = x.begin();it != x.end();it++)
Even then the code won't work since next() will return x.end() when you're processing the last item.
NetBeans and C++11 support question - NetBeans Forum
https://forums.netbeans.org/post-134485.html
c++ - Configuring C++11 in Netbeans - Stack Overflow
https://stackoverflow.com/questions/14867428/configuring-c11-in-netbeans
c++ - how do I add -std=c++11 to the compiler options in my Netbeans IDE - Stack Overflow
https://stackoverflow.com/questions/25683355/how-do-i-add-std-c11-to-the-compiler-options-in-my-netbeans-ide