<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>kabakiyo</author_name>
  <author_url>https://blog.hatena.ne.jp/kabakiyo/</author_url>
  <blog_title>遅咲きのエンジニア</blog_title>
  <blog_url>https://kabakiyo.hatenadiary.org/</blog_url>
  <categories>
    <anon>C++</anon>
  </categories>
  <description>ヘッダーファイルだけで関数を定義したいときがありますが、定義の仕方によってはリンクエラーになるので、そのときの挙動についてまとめました。 extern（外部リンゲージ） 各ソースファイルに関数が定義されるので、同じ関数が複数のファイルに存在することになりリンク時にエラーになる。※externのついていない関数はデフォルトでexternになる void func() { } static（内部リンゲージ） 各ソースファイルにstaticとして関数が定義されるので、エラーにはならないが同じ関数がいくつもできてしまう static void func() { } どうせヘッダーで関数を定義するなら、…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fkabakiyo.hatenadiary.org%2Fentry%2F20130304%2F1362369064&quot; title=&quot;ヘッダーファイルで関数の定義 - 遅咲きのエンジニア&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>2013-03-04 12:51:04</published>
  <title>ヘッダーファイルで関数の定義</title>
  <type>rich</type>
  <url>https://kabakiyo.hatenadiary.org/entry/20130304/1362369064</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
