<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>giantneco</author_name>
  <author_url>https://blog.hatena.ne.jp/giantneco/</author_url>
  <blog_title>giantnecoの日記</blog_title>
  <blog_url>https://giantneco.hatenadiary.org/</blog_url>
  <categories>
    <anon>C</anon>
  </categories>
  <description>こういうのがあるとは驚いた。C11 では _Generic という型を判別して結果を返すというマクロがあります。下のサンプルコードのように引数の型をみて値を返すことが可能です。 #include &lt;stdio.h&gt; int main() { const char * c = _Generic( 'a', char: &quot;char&quot;, int: &quot;int&quot;, long: &quot;long&quot;, default: &quot;default&quot;); printf(&quot;%s\n&quot;, c); } 少し遊んでみたのですが、構造体、ポインタ、配列までいろいろな型を判断することができるようです。で、ちょっと使えそうなものとして考え…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fgiantneco.hatenadiary.org%2Fentry%2F20121029%2F1351513963&quot; title=&quot;C11 の型を扱うマクロ - giantnecoの日記&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-10-29 21:32:43</published>
  <title>C11 の型を扱うマクロ</title>
  <type>rich</type>
  <url>https://giantneco.hatenadiary.org/entry/20121029/1351513963</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
