<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>mjmania</author_name>
  <author_url>https://blog.hatena.ne.jp/mjmania/</author_url>
  <blog_title>のんびり読書日記</blog_title>
  <blog_url>https://fujimizu.hatenablog.com/</blog_url>
  <categories>
    <anon>Programming</anon>
  </categories>
  <description>この前自分のソースを読んでいたら、両方とも降順にソートするために作った比較関数なのに何故か不等号が逆になっていて、「うわ、ひどいバグ作っちゃった？！」って慌ててテストしたら問題なし。調べてみると、STLのvectorとpriority_queueのソート用比較関数は何故か不等号が逆になっちゃうんですね。 #include &lt;cstdlib&gt; #include &lt;vector&gt; #include &lt;queue&gt; #include &lt;iostream&gt; struct StructGreater { bool operator() (int a, int b) { return a &lt; b; } }…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ffujimizu.hatenablog.com%2Fentry%2F20090724%2F1248364127&quot; title=&quot; STLのvectorとpriority_queueのソート用比較関数は不等号が逆 - のんびり読書日記&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2009-07-24 00:48:47</published>
  <title> STLのvectorとpriority_queueのソート用比較関数は不等号が逆</title>
  <type>rich</type>
  <url>https://fujimizu.hatenablog.com/entry/20090724/1248364127</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
