xtd 0.2.0
Loading...
Searching...
No Matches
overload.hpp
Go to the documentation of this file.
1
4#pragma once
5#include "const_overload.hpp"
7
9namespace xtd {
14 template<typename ...args_t>
17 using const_overload_type<args_t...>::of;
18 using const_overload_type<args_t...>::operator();
19 using non_const_overload_type<args_t...>::of;
20 using non_const_overload_type<args_t...>::operator();
22
24
29 template<typename result_t>
30 constexpr auto operator()(result_t (*method)(args_t...)) const noexcept -> decltype(method) {return method;}
32
34
39 template<typename result_t>
40 static constexpr auto of(result_t (*method)(args_t...)) noexcept -> decltype(method) {return method;}
42 };
43
45
47 template<typename ...args_t>
48 inline constexpr overload_type<args_t...> overload;
50}
51
58#define overload_ xtd::overload
Contains xtd::const_overload.
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8
Contains xtd::non_const_overload.
Represents class that use to determine one of const overloaded methods.
Definition const_overload.hpp:14
Represents class that use to determine one of non const overloaded methods.
Definition non_const_overload.hpp:16
Represents class that use to determine one of const and non const overloaded methods.
Definition overload.hpp:15
constexpr auto operator()(result_t(*method)(args_t...)) const noexcept -> decltype(method)
Returns a pointer to an overloaded method. The template parameter is the list of the argument types o...
Definition overload.hpp:30
static constexpr auto of(result_t(*method)(args_t...)) noexcept -> decltype(method)
Returns a pointer to an overloaded method. The template parameter is the list of the argument types o...
Definition overload.hpp:40