title: Initializing an array of pair in C++
body: <p>I want to initialize an array of pair in the following way:</p>
  
  <pre><code>pair&lt;int, int&gt; adjs[4] = {{current_node.first-1, current_node.second}, {current_node.first+1, current_node.second}, {current_node.first, current_node.second-1}, {current_node.first, current_node.second+1}};
  </code></pre>
  
  <p>However my compiler, Code::Blocks 12.1, keeps on throwing the error:</p>
  
  <pre><code>brace-enclosed initializer used to initialize `std::pair&lt;int, int&gt;'|
  </code></pre>
  
  <p>I used this method once before on an online compiler and it worked. So is it the problem with the compiler or some syntax issue in my code?
  I don't want to initialize 4 pair one by one. Suggest a way in which I can get rid of this error.</p>