define a custom Compare for multiset
<pre><code>function&lt;bool(const pair&lt;int, int&gt;&amp;, const pair&lt;int, int&gt;&amp;)&gt; cmp = [](const pair&lt;int, int&gt; &amp; left, const pair&lt;int, int&gt; &amp; right){if(left &gt; right) return true;};

//multiset&lt;pair&lt;int, int&gt;, function&lt;bool(const pair&lt;int, int&gt;&amp;, const pair&lt;int, int&gt;&amp;)&gt; mt(cmp);
multiset&lt;pair&lt;int, int&gt;, decltype(cmp)&gt; mt1(cmp);

cout&lt;&lt;typeid(decltype(cmp)).name()&lt;&lt;endl&lt;&lt;typeid(cmp).name()&lt;&lt;endl;
</code></pre>

<p>the comment code(<code>mt</code>) will make an error whereas the line below(<code>mt1</code>) won't.</p>

<p>I tried to <code>cout</code> the name of two type and they are the same.<br></p>

<p>Besides, I also tried like this:<br></p>

<pre><code>multiset&lt;pair&lt;int, int&gt;, const function&lt;bool(const pair&lt;int, int&gt;&amp;, const pair&lt;int, int&gt;&amp;) &amp;&gt; mt(cmp);
</code></pre>

<p>or</p>

<pre><code>multiset&lt;pair&lt;int, int&gt;, function&lt;bool(const pair&lt;int, int&gt;&amp;, const pair&lt;int, int&gt;&amp;) &amp;&gt; mt(cmp);
</code></pre>

<p>All of them don't work.</p>

<p>So what is the type of the second argument exactly? If I don't use <code>decltype</code>, how can I declare it?</p>