title: Regex search won't accept parameter
body: <p>Can someone kindly explain why in the code below there is one line that generates an error ?
  For comparison, the next line compiles correctly.
  For some reasons, the casting to std::string is not the same as suppling a std:: string type variable.
  I am using Visual Studio 2019, C++, console application with default options.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;regex&gt;
  
  int main()
  {
      std::regex e;
      std::smatch sm;
      std::string str("abc");
      std::regex_search(std::string("abc"), sm, e);  // Doesn't compile
      std::regex_search(str, sm, e);  // Compiles correctly
  }
  </code></pre>
  
  <p>Here's the error given by the pre-compiler
  Sorry for the italian...</p>
  
  <p>Gravità Codice  Descrizione Progetto    File    Riga    Stato eliminazione
  Errore (attivo) E1776   impossibile fare riferimento a funzione "std::regex_search(const std::basic_string&lt;_Elem, _StTraits, _StAlloc> &amp;&amp;, std::match_results::const_iterator, _Alloc> &amp;, const std::basic_regex&lt;_Elem, _RxTraits> &amp;, std::regex_constants::match_flag_type = std::regex_constants::match_default) [con _StTraits=std::char_traits, _StAlloc=std::allocator, _Alloc=std::allocator, std::_String_iter_types>>>>>, _Elem=char, _RxTraits=std::regex_traits]" (dichiarato alla riga 2300 di "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\include\regex"). È una funzione eliminata ConsoleApplication3 C:\Users\munarid\source\repos\Unit-Test-Generation_Support\ConsoleApplication3\ConsoleApplication3.cpp  9   </p>