<?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>Secret Garden(Instrumental)</blog_title>
  <blog_url>https://secret-garden.hatenablog.com/</blog_url>
  <categories>
    <anon>C++</anon>
  </categories>
  <description>ほぼ使うことはないだろうけど、かなりの知見だったので覚書。 ラムダ式を関数ポインタ型へ変換する これは割と一般的な知識だと思うんですが、『キャプチャしていない』ラムダ式は関数ポインタ型へとキャストする事が出来ます。 using func_t = int(*)(int); // 関数ポインタ型として受け取る事が出来る func_t twice = [](int n){ return n + n; }; + 単項演算子で明示的に関数ポインタ型に変換する さて、これを踏まえて次のように『関数ポインタ型を型推論する』ような関数にラムダ式を渡したいとします。 // テンプレートで戻り値型や引数型を推論す…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fsecret-garden.hatenablog.com%2Fentry%2F2017%2F08%2F12%2F201711&quot; title=&quot;C++ のラムダ式を型推論しながら関数ポインタ型で受け取る - Secret Garden(Instrumental)&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-08-12 20:17:11</published>
  <title>C++ のラムダ式を型推論しながら関数ポインタ型で受け取る</title>
  <type>rich</type>
  <url>https://secret-garden.hatenablog.com/entry/2017/08/12/201711</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
