title: openMP initialization of the iterator in the for loop with curly braces
body: <p>I have this main :</p>
  <pre><code>int main() {
  
      std::size_t n{10000};
      std::vector&lt;int&gt; A(n);
  
      for (size_t k{0}; k &lt; 10000; ++k) { // repeating the same task over and over again.
  #pragma omp parallel default(shared)
          {
  #pragma omp for    
              for (size_t i = 0; i &lt; n; ++i) {
                  A[i] = i;
              }
          }
      }
      return 0;
  }
  </code></pre>
  <p>I have the following problem, the initialization with the list initializer (curly braces) does not work :</p>
  <p>this works</p>
  <pre><code>        for (size_t i = 0; i &lt; n; ++i) {
              A[i] = i;
          }
  </code></pre>
  <p>this doesn't</p>
  <pre><code>        for (size_t i{0}; i &lt; n; ++i) {
              A[i] = i;
          }
  </code></pre>
  <p>do you have any idea why ? I have been told one should always initialize with curly braces, instead of <code>=</code> or normal braces <code>( )</code>.</p>
  <hr />
  <p>I use MinGW, on CLion and I fixed my CMake regarding OpenMP as:</p>
  <pre><code>FIND_PACKAGE(OpenMP REQUIRED)
  if (OPENMP_FOUND)
      set(CMAKE_C_FLAGS &quot;${OpenMP_C_FLAGS}&quot;)
      set(CMAKE_CXX_FLAGS &quot;${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}&quot;)
      set(CMAKE_EXE_LINKER_FLAGS &quot;${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}&quot;)
  endif()
  </code></pre>