title: error: use of deleted function bool regex_match with gcc 5.2.0
body: <p>The code compiled with GCC 4.9.2 without even any warning, but shows the following error in GCC 5.2.0:</p>
  
  <pre><code>error: use of deleted function ‘bool std::regex_match(const std::__cxx11::basic_string&lt;_Ch_type, _Ch_traits, _Ch_alloc&gt;&amp;&amp;, std::__cxx11::match_results&lt;typename std::__cxx11::basic_string&lt;_Ch_type, _Ch_traits, _Ch_alloc&gt;::const_iterator, _Alloc&gt;&amp;, const std::__cxx11::basic_regex&lt;_Ch_type, _Rx_traits&gt;&amp;, std::regex_constants::match_flag_type) [with _Ch_traits = std::char_traits&lt;char&gt;; _Ch_alloc = std::allocator&lt;char&gt;; _Alloc = std::allocator&lt;std::__cxx11::sub_match&lt;__gnu_cxx::__normal_iterator&lt;const char*, std::__cxx11::basic_string&lt;char&gt; &gt; &gt; &gt;; _Ch_type = char; _Rx_traits = std::__cxx11::regex_traits&lt;char&gt;; typename std::__cxx11::basic_string&lt;_Ch_type, _Ch_traits, _Ch_alloc&gt;::const_iterator = __gnu_cxx::__normal_iterator&lt;const char*, std::__cxx11::basic_string&lt;char&gt; &gt;]’
       if(std::regex_match(toString(index),result,re)){negative_flag = true;}
  </code></pre>
  
  <p>Piece of code that's throwing the error:</p>
  
  <pre><code>bool negative_flag=false;
  std::regex re("-[^-]*");
  std::smatch result;
  if(std::regex_match(toString(index),result,re)){negative_flag = true;}
  </code></pre>
  
  <p>The error is in the <code>if</code> line. What might be causing this?</p>