libER 0.1.4.2
ELDEN RING API library
Loading...
Searching...
No Matches
from_shared_ptr.hpp
Go to the documentation of this file.
1
8#pragma once
9
10#include <concepts>
13#include <memory>
14
15namespace from {
20template <typename T>
21using shared_ptr = std::shared_ptr<T>;
22
32template <typename T, typename... Args>
33[[nodiscard]] from::shared_ptr<T> make_shared(Args&&... args) {
35 using altraits = std::allocator_traits<decltype(allocator)>;
36 T* p = altraits::allocate(allocator, 1);
37 if (!p)
38 return nullptr;
39 altraits::construct(allocator, p, std::forward<Args>(args)...);
41}
42} // namespace from
The main libER stand-in for ER allocator proxies.
Definition from_allocator.hpp:308
ELDEN RING allocation interface and from::allocator.
Delay deleter implementation.
std::shared_ptr< T > shared_ptr
std::shared_ptr with from::allocator and from::delay_delete.
Definition from_shared_ptr.hpp:21
from::shared_ptr< T > make_shared(Args &&... args)
from::shared_ptr make_shared implementation.
Definition from_shared_ptr.hpp:33
Delay deleter that models std::default_delete.
Definition from_delay_delete.hpp:36