ПК
Size: a a a
ПК
ПК
AM
ПК
AS
ПК
AM
AM
ПК
K
IZ
AF
const std::string name = "World";Надеюсь, доживу.
const int number = 42;
print(f"Hello, {name}! The answer is {number}. Goodbye, {name}.");
AF
ПК
AF
ПК
AF
ПК
m
SS
template<typename T>подскажите плз, есть ли возможность адекватно достучаться через -> до std::string? Или все же кастомный deleter сделать
class ResourceManager
{
T *m_resource;
public:
ResourceManager()
{
m_resource = new T;
}
~ResourceManager()
{
delete m_resource;
}
T *operator->() noexcept
{
return m_resource;
}
};
int main()
{
std::unique_ptr<ResourceManager<std::string>> ptr;
ptr->size();
return 0;
}