Krita Source Code Documentation
Loading...
Searching...
No Matches
KisLazyValueWrapper.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2023 Dmitry Kazakov <dimula73@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6#ifndef KISLAZYVALUEWRAPPER_H
7#define KISLAZYVALUEWRAPPER_H
8
9#include <functional>
10
16template <typename T>
18{
19 using value_type = T;
20
22
23 explicit KisLazyValueWrapper(std::function<value_type()> func) {
24 value = func();
25 }
26
28
29 operator const value_type&() const {
30 return value;
31 }
32
35
38
40};
41
42#endif // KISLAZYVALUEWRAPPER_H
KisLazyValueWrapper & operator=(KisLazyValueWrapper &&rhs)=default
KisLazyValueWrapper(const KisLazyValueWrapper &rhs)=delete
KisLazyValueWrapper(std::function< value_type()> func)
KisLazyValueWrapper(KisLazyValueWrapper &&rhs)=default
~KisLazyValueWrapper()=default
KisLazyValueWrapper()=default
KisLazyValueWrapper & operator=(const KisLazyValueWrapper &rhs)=delete