CyberEngineMkIII
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
UniquePointer.hpp
Go to the documentation of this file.
1 #pragma once
3 
4 namespace CYB {
5  namespace API {
7  template <typename AType> class UniquePointer : public std::unique_ptr<AType, void(*)(AType* const)> {
8  private:
10  using BaseType = std::unique_ptr<AType, void(*)(AType* const)>;
11  private:
20  static BaseType InitBase(AType* const APointer, std::true_type AIsDestructible) noexcept;
29  static BaseType InitBase(AType* const APointer, std::false_type AIsDestructible) noexcept;
30 
37  static void Deallocate(AType* const APointer) noexcept;
44  static void Delete(AType* const APointer) noexcept;
45  public:
51  constexpr UniquePointer() noexcept;
58  constexpr UniquePointer(const std::nullptr_t AIgnored) noexcept;
65  explicit UniquePointer(AType* const APointer) noexcept;
66  };
67  };
68 };
69 
70 #include "UniquePointer.inl"
static void Delete(AType *const APointer) noexcept
Deletes APointer using the Allocator.
std::unique_ptr< CYB::Engine::Logger::LogEntry, void(*)(CYB::Engine::Logger::LogEntry *const)> BaseType
For readibility and fighting a bug with namespaced template base class constructors.
static BaseType InitBase(AType *const APointer, std::true_type AIsDestructible) noexcept
Used by this type's constructors.
static void Deallocate(AType *const APointer) noexcept
Deallocates APointer using the Allocator's Heap.
UniquePointer that uses our Allocator.
constexpr UniquePointer() noexcept
Initialize an empty UniquePointer.