Clio  develop
The XRP Ledger API server.
Loading...
Searching...
No Matches
Any.hpp
1#pragma once
2
3#include <any>
4#include <type_traits>
5
6namespace util::async::impl {
7
20class Any {
21 std::any value_;
22
23public:
24 Any() = default;
25 Any(Any const&) = default;
26
27 Any(Any&&) = default;
28 // note: this needs to be `auto` instead of `std::any` because of a bug in gcc 11.4
29 Any(auto&& v)
30 requires(std::is_same_v<std::decay_t<decltype(v)>, std::any>)
31 : value_{std::forward<decltype(v)>(v)}
32 {
33 }
34
35 operator std::any&() noexcept
36 {
37 return value_;
38 }
39};
40
41} // namespace util::async::impl