title: What are transparent comparators?
body: <p>In C++14, associative containers seem to have changed from C++11 &ndash; [associative.reqmts]/13 says:</p>
  
  <blockquote>
    <p>The member function templates <code>find</code>, <code>count</code>, <code>lower_bound</code>, <code>upper_bound</code>, and <code>equal_range</code> shall not participate in overload resolution unless the type <code>Compare::is_transparent</code> exists.</p>
  </blockquote>
  
  <p>What is the purpose of making an comparator "transparent"?</p>
  
  <p>C++14 also provides library templates like this:</p>
  
  <pre><code>template &lt;class T = void&gt; struct less {
      constexpr bool operator()(const T&amp; x, const T&amp; y) const;
      typedef T first_argument_type;
      typedef T second_argument_type;
      typedef bool result_type;
  };
  
  template &lt;&gt; struct less&lt;void&gt; {
      template &lt;class T, class U&gt; auto operator()(T&amp;&amp; t, U&amp;&amp; u) const
      -&gt; decltype(std::forward&lt;T&gt;(t) &lt; std::forward&lt;U&gt;(u));
      typedef *unspecified* is_transparent;
  };
  </code></pre>
  
  <p>So for example, <code>std::set&lt;T, std::less&lt;T&gt;&gt;</code> would <em>not</em> have a transparent comparator, but <code>std::set&lt;T, std::less&lt;&gt;&gt;</code> <em>would</em> have one.</p>
  
  <p>What problem does this solve, and does this change how standard containers work? For example, the template parameters of <code>std::set</code> are still <code>Key, Compare = std::less&lt;Key&gt;, ...</code>, so does the default set lose its <code>find</code>, <code>count</code>, etc. members?</p>