<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>toburau</author_name>
  <author_url>https://blog.hatena.ne.jp/toburau/</author_url>
  <blog_title>ゲームが作れるようになるまでがんばる日記</blog_title>
  <blog_url>https://toburau.hatenablog.jp/</blog_url>
  <categories>
    <anon>勉強</anon>
    <anon>C++</anon>
  </categories>
  <description>久しぶりにEffective C++を読みながら勉強の再開。第4章20項。 関数にオブジェクトを渡すときは値渡しよりもconst参照渡しを使うほうが良い。値渡しではオブジェクトのコピーが行われるためコンストラクタやデストラクタが実行されることになる。const参照渡しなら新しいオブジェクトの生成が行われないため効率が良い。 またconst参照渡しにすると「スライス問題」も避けることができる。スライス問題とは派生クラスのオブジェクトを基底クラスの引数を持つ関数に渡すと派生クラスの部分が切り捨てられてしまうこと。つまり仮想関数でオーバーライドした部分がなくなってしまう。これもconst参照渡しにす…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftoburau.hatenablog.jp%2Fentry%2F20101016%2F1287239459&quot; title=&quot;const参照渡し - ゲームが作れるようになるまでがんばる日記&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>2010-10-16 23:30:59</published>
  <title>const参照渡し</title>
  <type>rich</type>
  <url>https://toburau.hatenablog.jp/entry/20101016/1287239459</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
