title: Why aren't C++14 standard-defined literals in the global namespace by default?
body: <p>C++14 includes standard-defined literals for, amongst other things, <code>std::string</code> and various timespans from the <code>&lt;chrono&gt;</code> header.</p>
  
  <p>To use them you must say <code>using namespace std::literals;</code> (or some variation depending on exactly which literals you want, as they're in a variety of inline namespaces).</p>
  
  <p>All this is good, but I'm curious as to why the <code>using</code> declaration is required. UDLs without a leading underscore are reserved for the implementation, so there is no possibility that <code>"hello world"s</code> could ever mean anything else in a standard-conforming programme.</p>
  
  <p>So why isn't <code>#include &lt;string&gt;</code> sufficient to bring the literal conversion function into scope? Why must I explicitly include the literal namespace?</p>
  
  <p><strong>EDIT:</strong> <a href="http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2013/n3531.pdf">N3531</a> is the most recent version of the proposal I could find -- unfortunately it doesn't discuss the motivation for putting things in a namespace but only says:</p>
  
  <blockquote>
    <p>One can summarize the requirements of the [Portland] discussion as follows:</p>
    
    <ul>
    <li>use an inline namespace for a (group of related) UDL operator(s)</li>
    </ul>
  </blockquote>