#include <ugmisc/member.hpp>
Public Types | |
| using | safe_matched_type = ??? |
| using | matched_type = ??? |
Static Public Member Functions | |
| template<class F, class... A> | |
| static constexpr decltype(auto) | get (F &&default_get, A &&...args) |
| static constexpr auto & | get () |
Static Public Attributes | |
| static constexpr bool | has_member = ??? |
Finds a reference to a named static member value in the first type among T... which has a static value accessible by that name.
The Access is responsible for knowing the name to use, and is a type declared with the help of the UGMISC_DECL_MEMBER_ACCESS macro.
For example:
In the example above, the value of foo1 will be the first of the following which is valid:
If neither of those is valid, the declaration is an error.
The value of foo2 will be the first valid value of the following:
| Access | A type declared using UGMISC_DECL_MEMBER_ACCESS. This is responsible for accessing the correctly named static member, according to the second argument passed to the macro. |
| T | The types in which to look for the named member. |
Definition at line 1562 of file member.hpp.
| using ugmisc::static_member_value< Access, T >::matched_type = ??? |
The type whose named static member would be referenced by get(), if there is one. This member type is not declared if has_member is false.
Definition at line 1604 of file member.hpp.
| using ugmisc::static_member_value< Access, T >::safe_matched_type = ??? |
The type whose named static member would be referenced by get(), if there is one, or void if there is not.
Definition at line 1597 of file member.hpp.
|
inlinestaticconstexpr |
Definition at line 1589 of file member.hpp.
|
staticconstexpr |
Like get() but with a default value. The value is provided by a callable parameter, which is passed the args.
This way side effects of getting the default value can be avoided if it is not needed.
| default_get | A function or callable object. |
| args | Optional arguments to pass to default_get. |
|
staticconstexpr |
true if one of the types in T... has a member value accessed by Access.
Definition at line 1569 of file member.hpp.