xtd 0.2.0
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 type_t any_cast(const xtd::any& operand) {
23 return std::any_cast<type_t>(operand);
24 }
25
38 template<class type_t>
39 type_t any_cast(xtd::any& operand) {
40 return std::any_cast<type_t>(operand);
41 }
42
55 template<class type_t>
56 type_t any_cast(xtd::any&& operand) {
57 return std::any_cast<type_t>(operand);
58 }
59
73 template<class type_t>
74 type_t* any_cast(xtd::any* operand) {
75 return std::any_cast<type_t>(operand);
76 }
77
91 template<class type_t>
92 type_t* any_cast(const xtd::any* operand) {
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
type_t any_cast(const xtd::any &operand)
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