m
Это плохо, это UB
Size: a a a
m
IZ
m
IZ
m
IZ
HH
D
IZ
S
ПЯ
S
h
struct A {
static std::shared_ptr<A> get_A() {
return std::make_shared<A>();
}
};
h
struct A {
static std::shared_ptr<A> get_A() {
return std::make_shared<A>();
}
};
struct A {
static std::shared_ptr<A> get_A() {
static const auto single_instance = std::make_shared<A>();
return one_instance;
}
};
h
struct A {
static std::shared_ptr<A> get_A() {
static const auto single_instance = std::make_shared<A>();
return one_instance;
}
};
ПК
struct A {
static std::shared_ptr<A> get_A() {
static const auto single_instance = std::make_shared<A>();
return one_instance;
}
};
АР
АР
struct A {
static std::shared_ptr<A> get_A() {
return std::make_shared<A>();
}
};
h