qxLib
smart_ptr_ref_adapter.inl
Go to the documentation of this file.
1 /**
2 
3  @file smart_ptr_ref_adapter.inl
4  @author Khrapov
5  @date 25.05.2025
6  @copyright © Nick Khrapov, 2025. All right reserved.
7 
8 **/
9 
10 namespace qx::details
11 {
12 
13 template<template<class, class...> class pointer_t, class T, class... args_t>
14 base_smart_ptr_ref_adapter<pointer_t, T, args_t...>::operator T&() noexcept
15 {
16  return *get();
17 }
18 
19 template<template<class, class...> class pointer_t, class T, class... args_t>
20 base_smart_ptr_ref_adapter<pointer_t, T, args_t...>::operator const T&() const noexcept
21 {
22  return *get();
23 }
24 
25 template<template<class, class...> class pointer_t, class T, class... args_t>
26 template<class... constructor_args_t>
27 base_smart_ptr_ref_adapter<pointer_t, T, args_t...>::base_smart_ptr_ref_adapter(constructor_args_t&&... args)
28  : original_pointer_type(std::forward<constructor_args_t>(args)...)
29 {
30  // QX_ASSERT(original_pointer_type::get());
31 }
32 
33 template<template<class, class...> class pointer_t, class T, class... args_t>
34 typename base_smart_ptr_ref_adapter<pointer_t, T, args_t...>::reference overload_functions_smart_ptr_ref_adapter<
35  pointer_t,
36  T,
37  args_t...>::get() const noexcept
38 {
39  return *super::original_pointer_type::get();
40 }
41 
42 template<template<class, class...> class pointer_t, class T, class... args_t>
43 template<class... constructor_args_t>
44 overload_functions_smart_ptr_ref_adapter<pointer_t, T, args_t...>::overload_functions_smart_ptr_ref_adapter(
45  constructor_args_t&&... args)
46  : super(std::forward<constructor_args_t>(args)...)
47 {
48 }
49 
50 } // namespace qx::details