<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>kazuhooku</author_name>
  <author_url>https://blog.hatena.ne.jp/kazuhooku/</author_url>
  <blog_title>kazuhoのメモ置き場</blog_title>
  <blog_url>https://kazuhooku.hatenadiary.org/</blog_url>
  <categories>
  </categories>
  <description>たとえば libevent のような C 言語でかかれたイベント駆動型のライブラリを C++ から使っていると、C++ のメンバ関数をコールバックとしてセットできたらうれしいことが多いですよね。以下のようにすればできます。たとえば、コールバック関数をセットする関数の型が、 void set_foo_callback(void (*)(void* cb_arg), void* cb_arg); なら、以下のようにクラスとメンバ関数を引数にとるテンプレート関数を定義し、 template &lt;typename T, void (T::*FUNC)()&gt; void to_foo_callback(vo…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fkazuhooku.hatenadiary.org%2Fentry%2F20110126%2F1296031454&quot; title=&quot; Cのコールバック関数をC++のメンバ関数にバインディングする方法 - kazuhoのメモ置き場&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>2011-01-26 17:44:14</published>
  <title> Cのコールバック関数をC++のメンバ関数にバインディングする方法</title>
  <type>rich</type>
  <url>https://kazuhooku.hatenadiary.org/entry/20110126/1296031454</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
