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
33template <typename T,
34 typename AllocatorTag = from::default_allocator_tag,
35 typename... Args>
36[[nodiscard]] from::shared_ptr<T> make_shared(Args&&... args) {
37 using allocator_type = from::allocator<T, AllocatorTag>;
38 allocator_type allocator;
39 T* p = allocator.allocate(1);
40 std::allocator_traits<allocator_type>::construct(allocator, p,
41 std::forward<Args>(args)...);
43}
44} // namespace from
The main libER stand-in for ER allocator proxies.
Definition from_allocator.hpp:310
T * allocate(size_type n)
Allocate n instances of uninitialized memory for T.
Definition from_allocator.hpp:388
Delay deleter that models std::default_delete.
Definition from_delay_delete.hpp:37
ELDEN RING allocation interface and from::allocator.
Delay deleter implementation.
from::shared_ptr< T > make_shared(Args &&... args)
from::shared_ptr make_shared implementation.
Definition from_shared_ptr.hpp:36
std::shared_ptr< T > shared_ptr
std::shared_ptr with from::allocator and from::delay_delete.
Definition from_shared_ptr.hpp:21
Default libER allocator that gets embedded in objects as needed for ER ABI compatibility.
Definition from_allocator.hpp:285