<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>osyo-manga</author_name>
  <author_url>https://blog.hatena.ne.jp/osyo-manga/</author_url>
  <blog_title>C++でゲームプログラミング</blog_title>
  <blog_url>https://osyo-manga.hatenadiary.org/</blog_url>
  <categories>
    <anon>C++</anon>
  </categories>
  <description>例えば、次のような除算を行う関数で、ゼロ除算の場合にエラーを出力したいと思います。 constexpr int division(int a, int b){ return a / b; } constexpr int x1 = division(4, 2); // ok constexpr int x2 = division(4, 0); // ゼロ除算を行うのでエラー 本当なら関数内で static_assert(b == 0, &quot;division by zero&quot;) と書きたいのですが、残念ながら関数内で b が constexpr か判断する事は出来ないので static_assert…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fosyo-manga.hatenadiary.org%2Fentry%2F20120119%2F1326899383&quot; title=&quot;constexpr でエラー出力 - 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>2012-01-19 00:09:43</published>
  <title>constexpr でエラー出力</title>
  <type>rich</type>
  <url>https://osyo-manga.hatenadiary.org/entry/20120119/1326899383</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
