P4C
The P4 Compiler
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
rvalue_reference_wrapper.h
1
17
18#ifndef BACKENDS_TOFINO_BF_ASM_RVALUE_REFERENCE_WRAPPER_H_
19#define BACKENDS_TOFINO_BF_ASM_RVALUE_REFERENCE_WRAPPER_H_
20
21template <class T>
22class rvalue_reference_wrapper {
23 T *ref;
24
25 public:
26 typedef T type;
27 rvalue_reference_wrapper(T &&r) : ref(&r) {} // NOLINT(runtime/explicit)
28 template <class U>
29 rvalue_reference_wrapper(U &&r) : ref(&r) {} // NOLINT(runtime/explicit)
30 T &&get() { return std::move(*ref); }
31};
32
33#endif /* BACKENDS_TOFINO_BF_ASM_RVALUE_REFERENCE_WRAPPER_H_ */