<?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>std::optionalとstd::shared_ptrを両方使っていると、空状態を設定するためにあっちはstd::nullopt、こっちはnullptrのように指定するので、使い分けがわずらわしいときがあります。 なにも考えず{}を指定してもよいのですが、「値初期化というのではなく空状態を指定することを示したい！」という欲求があるので、std::optionalとstd::shared_ptr両方の空状態に変換できるオブジェクトがあると便利かなと思ったりします。 #include &lt;optional&gt; #include &lt;memory&gt; struct unified_null { temp…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ffaithandbrave.hateblo.jp%2Fentry%2F2022%2F11%2F30%2F131335&quot; title=&quot;optionalとshared_ptrで共通のnull - 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>2022-11-30 13:13:35</published>
  <title>optionalとshared_ptrで共通のnull</title>
  <type>rich</type>
  <url>https://faithandbrave.hateblo.jp/entry/2022/11/30/131335</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
