xtd 0.2.0
Loading...
Searching...
No Matches
any_cast.hpp
Go to the documentation of this file.
1
3#pragma once
4#include "any.hpp"
5
7namespace xtd {
21 template<class type_t>
22 [[nodiscard]] auto any_cast(const xtd::any& operand) -> type_t {
23 return std::any_cast<type_t>(operand);
24 }
25
38 template<class type_t>
39 [[nodiscard]] auto any_cast(xtd::any& operand) -> type_t {
40 return std::any_cast<type_t>(operand);
41 }
42
55 template<class type_t>
56 [[nodiscard]] auto any_cast(xtd::any&& operand) -> type_t {
57 return std::any_cast<type_t>(operand);
58 }
59
73 template<class type_t>
74 [[nodiscard]] auto any_cast(xtd::any* operand) -> type_t* {
75 return std::any_cast<type_t>(operand);
76 }
77
91 template<class type_t>
92 [[nodiscard]] auto any_cast(const xtd::any* operand) -> type_t* {
93 return std::any_cast<type_t>(operand);
94 }
95}
Contains xtd::any type and std::bad_any_cast exception.
std::any any
Represents the any alias on std::any.
Definition any.hpp:24
auto any_cast(const xtd::any &operand) -> type_t
Performs type-safe access to the contained object.
Definition any_cast.hpp:22
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8