Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私は基本的にクラスconstとdestとしてC++のコードを持っています
Abc(vector<std::string>& names); virtual ~Abc();
C#で同等のものを知る必要があります
ありがとう
C# では、次のように記述できます。
Abc(List<string> names);
~Abc()C#では を使用しません。ガベージコレクターがあります。
~Abc()
ただし、クラスがリソースを管理する場合は、次のようなメソッドから派生AbcしIDisposableて実装します。Dispose()~Abc()
Abc
IDisposable
Dispose()
class Abc : IDisposable { Abc(ref List<string> names); void Dispose(); }