title: Resolve std::string to something else than ::std::string - is it possible?
body: <p><strong>This is a follow-up question from:</strong> <a href="https://stackoverflow.com/questions/58304063/constructing-string-from-null?noredirect=1#comment102975855_58304063">constructing string from NULL?</a></p>
  
  <p>The following:</p>
  
  <pre><code>void test(const std::string&amp; s);
  
  int main(){
    test(NULL);
  }
  </code></pre>
  
  <p>Fails when run, but is <strong>legal</strong> c++.</p>
  
  <p>In order to try to catch some of those cases, as an alternative ive considering if  <code>std::string</code> can be <em>replaced</em> in the following way:</p>
  
  <pre><code>#include &lt;string&gt;
  
  
  namespace {
  namespace std {
      struct string : public ::std::string { //so far everything is good
  
      };
  }
  }
  
  
  int main ()
   {
     std::string hello;//failure: ambiguous symbol
  
     return 0;
   }
  </code></pre>
  
  <p>Gives the following error:</p>
  
  <pre><code>&lt;source&gt;(17): error C2872: 'std': ambiguous symbol
  
  C:/data/msvc/14.22.27905/include\string(19): note: could be 'std'
  
  &lt;source&gt;(7): note: or       '`anonymous-namespace'::std'
  
  &lt;source&gt;(17): error C2872: 'std': ambiguous symbol
  
  C:/data/msvc/14.22.27905/include\string(19): note: could be 'std'
  
  &lt;source&gt;(7): note: or       '`anonymous-namespace'::std'
  
  Compiler returned: 2
  </code></pre>
  
  <p>I guess it is not possible to make it resolve without writing a more (fully) qualified name ? but is it possible to write std::string <strong>in the global namespace</strong> and have it resolve to something else while ::std::string <em>is</em> a valid type.</p>
  
  <p><strong>Background</strong>: after some failed attempts with cppcheck and cpp core check im trying to find all cases of <code>std::string str = 0</code> or <code>NULL</code> or <code>nullptr</code> - since those will fail at runtime. And I thought this might be a way forward.</p>
  
  <p><strong>I ended up modifying the basic_string template ala. <code>basic_string(int) = delete;
      basic_string(::std::nullptr_t) = delete;</code> - this won't catch all cases but does indeed seem to catch  the direct cases at least</strong></p>