31 #ifndef LEDGER_CORE_LAZY_HPP 32 #define LEDGER_CORE_LAZY_HPP 36 #include "Exception.hpp" 46 _creator = [] () -> std::shared_ptr<T> {
51 Lazy(std::function<std::shared_ptr<T> ()> creator) {
57 _creator = value._creator;
58 _value = value._value;
62 _creator = value._creator;
63 _value = value._value;
77 if (_value !=
nullptr)
85 template <
typename... Args>
86 static Lazy<T> make_lazy(Args... args) {
89 return std::make_shared<T>(args...);
94 std::function<std::shared_ptr<T> ()> _creator;
95 std::shared_ptr<T> _value;
101 #endif //LEDGER_CORE_LAZY_HPP
Definition: Account.cpp:8
Definition: Exception.hpp:45