NULL
デストラクタに (ヒープメモリを割り当てる) ポインタを設定するのは無意味ですか?
class SampleClass
{
public:
SampleClass( int Init = 0 )
{
Value = new int( Init );
}
~SampleClass( void )
{
delete Value;
Value = NULL; // Is this pointless?
}
int *Value;
};
クラスについてですが、いつexplicit
キーワードを使用する必要がありますか?