+ 1

Why can't we declare destructor as private?

why compiler giving error when destructor is declared as private?

21st Apr 2018, 7:00 PM
$±𝐎â‚č𝔭!𝐹𝓝
$±𝐎â‚č𝔭!𝐹𝓝 - avatar
1 RĂ©ponse
+ 3
Because it's implicitly called outside the class when an objects memory is freed.
21st Apr 2018, 7:01 PM
Timon Paßlick