<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>tshino</author_name>
  <author_url>https://blog.hatena.ne.jp/tshino/</author_url>
  <blog_title>tshinoの日記</blog_title>
  <blog_url>https://tshino.hatenablog.com/</blog_url>
  <categories>
    <anon>開発</anon>
    <anon>C++</anon>
  </categories>
  <description>C言語のライブラリを使っていると、構造体をデフォルト初期化してから、一部のメンバー変数だけ書き換えて利用することがしばしばあります。 option o = {}; o.name = &quot;hello&quot;; o.size = 1234; func(o); option 構造体のメンバー変数の仕様は一部だけが決まっていて、他のメンバー変数は実装詳細として隠されていたりします。 また、一部のメンバー変数だけ値を設定したい場合があります。 このような構造体の値を式の中でインラインで書く方法を考えてみました。 C++ではこうすれば良さそうです。 func([]{ option o = {}; o.name =…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftshino.hatenablog.com%2Fentry%2F20140612%2F1402532454&quot; title=&quot; C++で構造体の名前付き初期化 - tshinoの日記&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-06-12 09:20:54</published>
  <title> C++で構造体の名前付き初期化</title>
  <type>rich</type>
  <url>https://tshino.hatenablog.com/entry/20140612/1402532454</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
