mini-llvm 0.1.0
Loading...
Searching...
No Matches
ArrowProxy.h
Go to the documentation of this file.
1// SPDX-License-Identifier: MIT
2
3#pragma once
4
5#include <utility>
6
7namespace mini_llvm {
8
9template <typename T>
11public:
12 explicit constexpr ArrowProxy(T value)
13 : value_(std::move(value)) {}
14
15 template <typename... Args>
16 explicit constexpr ArrowProxy(std::in_place_t, Args &&...args)
17 : value_(std::forward<Args>(args)...) {}
18
19 constexpr T *operator->() {
20 return &value_;
21 }
22
23 template <typename... Args>
24 static constexpr ArrowProxy<T> make(Args &&...args) {
25 return ArrowProxy<T>(std::in_place, std::forward<Args>(args)...);
26 }
27
28private:
29 T value_;
30};
31
32} // namespace mini_llvm
constexpr ArrowProxy(T value)
Definition ArrowProxy.h:12
constexpr T * operator->()
Definition ArrowProxy.h:19
constexpr ArrowProxy(std::in_place_t, Args &&...args)
Definition ArrowProxy.h:16
static constexpr ArrowProxy< T > make(Args &&...args)
Definition ArrowProxy.h:24
Definition GraphColoringAllocator.h:13