<?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>クラス内にstatic constexpr Tで宣言した定数を、std::vector::emplace_back()関数とかに渡すと、リンクエラーになる場合があります。 ミニマムなコードとしては、以下のようになります： struct X { static constexpr int x = 3; }; template &lt;class T&gt; void f(T&amp;&amp;) {} int main() { f(X::x); // リンクエラー : X::xの実体が見つからない } クラスの静的定数は、宣言だけした場合にコピーはできますが、その変数のポインタや参照をとったりはできません。そのようなことをし…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ffaithandbrave.hateblo.jp%2Fentry%2F2017%2F10%2F16%2F160146&quot; title=&quot;静的なメンバ定数を参照するとリンクエラーとなる - 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>2017-10-16 16:01:46</published>
  <title>静的なメンバ定数を参照するとリンクエラーとなる</title>
  <type>rich</type>
  <url>https://faithandbrave.hateblo.jp/entry/2017/10/16/160146</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
