Bertini 2 d882924 (2026-10-06 19:56 UTC)
Numerical algebraic geometry library (C++ core)
Loading...
Searching...
No Matches
policies.hpp
Go to the documentation of this file.
1
2
3
4#pragma once
5#include <functional>
6
7namespace bertini{
8
9 namespace nag_datatype{
10
11 namespace policy{
12
14 template<typename T>
15 struct Copy
16 {
17 using HeldT = T;
18
19
21 static
22 const T & AtGet(HeldT const& t)
23 {
24 return t;
25 }
26
27 };
28
29
31 template<typename T>
32 struct Reference
33 {
34 using HeldT = std::reference_wrapper<T>;
35
36
38 static
39 const T & AtGet(HeldT const& t)
40 {
41 return t;
42 }
43
44 };
45
46
48 template<typename T>
49 struct SharedPtr
50 {
51 using HeldT = std::shared_ptr<T>;
52
53
55 static
56 const T & AtGet(HeldT const& t)
57 {
58 return *t;
59 }
60
61 };
62
63 }// policy
64 }// nag_datatype
65}//bertini
Definition policies.hpp:11
Definition policies.hpp:9
Definition algorithm_builder.hpp:36
Storage policy that holds objects by value (a copy).
Definition policies.hpp:16
static const T & AtGet(HeldT const &t)
Access the held object.
Definition policies.hpp:22
T HeldT
The held type (the object itself).
Definition policies.hpp:17
Storage policy that holds a reference to an externally-owned object.
Definition policies.hpp:33
static const T & AtGet(HeldT const &t)
Access the referenced object.
Definition policies.hpp:39
std::reference_wrapper< T > HeldT
The held type (a reference wrapper).
Definition policies.hpp:34
Storage policy that holds objects via std::shared_ptr.
Definition policies.hpp:50
static const T & AtGet(HeldT const &t)
Access the pointed-to object.
Definition policies.hpp:56
std::shared_ptr< T > HeldT
The held type (a shared pointer).
Definition policies.hpp:51