Implizite Art von Destruktor in C ++
Posted: 07 Feb 2025, 03:59
Ich weiß, dass ein Destruktor in C ++ keinen Wert zurückgibt und sein Typ kann nicht explizit angegeben werden. ist gemäß dem C ++ - Standard korrekt.
Code: Select all
#include
#include
using namespace std;
class X
{
};
int main()
{
X *x = new X();
char *fullname;
using destructor_type = decltype(x->~X());
const type_info &destructor_t = typeid(destructor_type);
fullname = abi::__cxa_demangle(destructor_t.name(), NULL, NULL, NULL);
cout