<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>faith_and_brave</author_name>
  <author_url>https://blog.hatena.ne.jp/faith_and_brave/</author_url>
  <blog_title>Faith and Brave - C++で遊ぼう</blog_title>
  <blog_url>https://faithandbrave.hateblo.jp/</blog_url>
  <categories>
    <anon>C++</anon>
  </categories>
  <description>基本クラスで仮想関数を定義したら、派生クラスではその関数に、virtualを付ける必要はありません。付けなくても、自動的に仮想関数になります。 #include &lt;iostream&gt; struct Base { virtual void f() { std::cout &lt;&lt; &quot;Base&quot; &lt;&lt; std::endl; } }; struct Derived : Base { void f() override { std::cout &lt;&lt; &quot;Derived&quot; &lt;&lt; std::endl; } }; int main() { Derived d; Base&amp; b = d; b.f(); } 出力： …</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ffaithandbrave.hateblo.jp%2Fentry%2F2014%2F03%2F19%2F164902&quot; title=&quot;派生クラスの仮想関数には、virtualを付ける必要はない - Faith and Brave - C++で遊ぼう&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>2014-03-19 16:49:02</published>
  <title>派生クラスの仮想関数には、virtualを付ける必要はない</title>
  <type>rich</type>
  <url>https://faithandbrave.hateblo.jp/entry/2014/03/19/164902</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
