公開イベント Bar を持つクラス Foo があります。Bar へのすべてのサブスクリプションをクリアする必要があります。
C# では (クラス Foo 内で) 次のように簡単です。
public void RemoveSubscribers() { this.Bar = null; }
(この質問も参照)
C++/CLI でこれを行うにはどうすればよいですか? Bar を nullptr に設定できません: コンパイラがエラーを吐き出します
Usage requires 'Foo::Bar' to be a data member
Bar の RemoveAll メソッドを見てきましたが、引数として何を指定すればよいかわかりません...
EDIT 1: わかりやすくするために、 Bar は次のように宣言されました。
public ref class Foo
{
public:
event MyEventHandler^ Bar;
};