title: How to correctly create std::string from a std::string_view?
body: <p>I have a class:</p>
  
  <pre><code>class Symbol_t {
  public:
     Symbol_t( const char* rawName ) {
        memcpy( m_V, rawName, 6 * sizeof( char ) );
     };
  
     string_view strVw() const {
        return string_view( m_V, 6 );
     };
  
  private:
     char m_V[6];
  
  }; // class Symbol_t
  </code></pre>
  
  <p>and there is a lib-func that I can't modify:</p>
  
  <pre><code>extern bool loadData( const string&amp; strSymbol );
  </code></pre>
  
  <p>If there is a local variable:</p>
  
  <pre><code>Symbol_t   symbol( "123456" );
  </code></pre>
  
  <p>When I need to call loadData, I dare not do it like this:</p>
  
  <pre><code>loadData( string( symbol.strVw().begin(), symbol.strVw().end() ) );
  </code></pre>
  
  <p>I have to do like this:</p>
  
  <pre><code>string_view svwSym = symbol.strVw();
  loadData( string( svw.begin(), svw.end() ) );
  </code></pre>
  
  <p>My question:
  Is the first method correct? or I must use the second one?</p>
  
  <p>Because I think that in Method 1, the iterators I passed to the constructor of std::string, are of two Different string_vew objects, and theoretically the result is undefined, even though we would get expected result with almost all of the C++ compilers.</p>
  
  <p>Any hints will be appreciated! thanks.</p>