LoginSignup
7
8

More than 3 years have passed since last update.

2015-04-28 c++ builder XE4 > __closureのまとめ

Last updated at Posted at 2015-04-28

http://homepage2.nifty.com/Km/contents/20120225.htm
__closureのコードサンプル。



C++Builderにおけるクロージャとは拡張関数ポインタとも呼べるものです。



VCL コンポーネント イベントはすべて、イベントが発生したときにクラスのメソッドを呼び出せるよう、クロージャとして宣言されます。



C++Builderの拡張機能であるclosureとpropertyを使うと、メンバ関数を実行時に他の関数と差し替えることができます。



__closureを使うのは以下のような時なのだろう。
  • 外部で定義した関数を呼びたい
  • 関数を切り替えて使いたい
7
8
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
8