title: How to initialize an unorderd_set using C++ (g++ compiler)?
body: <p>I observe the following error while trying to compile a sample code with g++</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;unordered_set&gt;
  
  int main () {
     std::unordered_set&lt;std::string&gt; second ( {"red","green","blue"} );    // init list
     std::unordered_set&lt;std::string&gt; second1 {"red", "green", "blue"}; // Marcelo Cantos
     std::unordered_set&lt;std::string&gt; second2{{"red", "green", "blue"}}; // Marcelo Cantos
     std::unordered_set&lt;std::string&gt; second3 = {"red", "green", "blue"};// Marcelo Cantos   
     return 0;
  
  }
  
  $ gcc -o wp -Wall -Wextra test_set.cpp 
  test_set.cpp:5:45: error: expected expression
     std::unordered_set&lt;std::string&gt; second ( {"red","green","blue"} )...
                                          ^
  test_set.cpp:6:43: error: expected ';' at end of declaration
     std::unordered_set&lt;std::string&gt; second1 {"red", "green", "blue"};
                                            ^
                                            ;
  test_set.cpp:7:43: error: expected ';' at end of declaration
     std::unordered_set&lt;std::string&gt; second2{{"red", "green", "blue"}};
                                            ^
                                            ;
  test_set.cpp:8:36: error: non-aggregate type 'std::unordered_set&lt;std::string&gt;' cannot be initialized with an initializer list
     std::unordered_set&lt;std::string&gt; second3 = {"red", "green", "blue"};
                                     ^         ~~~~~~~~~~~~~~~~~~~~~~~~
  4 errors generated.
  
  
  $ g++ --version
  Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
  Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
  Target: x86_64-apple-darwin13.3.0
  Thread model: posix
  </code></pre>
  
  <p>Solved by using compiler option "-std=c++11". </p>
  
  <p>$ g++ -o test_set -Wall -Wextra -std=c++11 test_set.cpp </p>