Contradiction in C++ standard?
<p>A <code>std::map</code> must satisfy the requirements of an associative container specified in paragraph 23.1.2/2:</p>

<blockquote>
  <p>Each associative container is
  parameterized on Key and an ordering
  relation Compare that induces a strict
  weak ordering (25.3) on elements of
  Key. In addition, map and multimap
  associate an arbitrary type T with the
  Key. The object of type Compare is
  called the comparison object of a
  container. This comparison object may
  be a <strong>pointer to function</strong> or an object
  of a type with an appropriate function
  call operator.</p>
</blockquote>

<p>But then in paragraph 23.3.1/2 the <code>std::map</code> template is specified as:</p>

<pre><code>template &lt;class Key, class T, class Compare = less&lt;Key&gt;,
          class Allocator = allocator&lt;pair&lt;const Key, T&gt; &gt; &gt;
class map;
</code></pre>

<p>which seems to explicitly prohibit the use of a function pointer as <code>Compare</code>. Is this a contradiction or am I not understanding the standard correctly?</p>

<p><strong>EDIT:</strong> Yes, the problem I was really having was why code like GMan's example:</p>

<pre><code>struct foo
{
    int x;
};

bool compare_foo(const foo&amp; x, const foo&amp; y)
{
    return x.x &lt; y.x;
}

std::map&lt;foo, bool, compare_foo&gt; fooMap;
</code></pre>

<p>wouldn't compile (yeah, I stupidly mixed up the type and value of the <code>Compare</code> parameter).</p>
