<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>Cryolite</author_name>
  <author_url>https://blog.hatena.ne.jp/Cryolite/</author_url>
  <blog_title>Cry's Blog</blog_title>
  <blog_url>https://blog.cryolite.net/</blog_url>
  <categories>
    <anon>C++</anon>
    <anon>Standard Template Library</anon>
  </categories>
  <description>ユーザ定義型に対してswapを特殊化することは良くある．で，このやり方に2通り考えられる． std::swapを特殊化する(#1) その型と同じ名前空間でswapを定義する(#2) それぞれ，以下のようになる． namespace my_lib{ class X{ ..... }; void swap(X &amp;x, X &amp;y) // #2 { ..... } } #include &lt;algorithm&gt; // std::swapのprimary templateの宣言を取り込む namespace std{ void swap(my_lib::X &amp;x, my_lib::X &amp;y) // #1 …</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.cryolite.net%2Fentry%2F20040902%2Fp1&quot; title=&quot;swapの特殊化 - Cry&amp;#39;s Blog&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>2004-09-02 00:00:00</published>
  <title>swapの特殊化</title>
  <type>rich</type>
  <url>https://blog.cryolite.net/entry/20040902/p1</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
