HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
hi::v1::selector< T > Struct Template Reference

Detailed Description

template<typename T>
struct hi::v1::selector< T >

This selector allows access to member variable by name.

An application may add a specialization for selector for its own type. The specialization should add a templated function get() to give access to members based on the template parameter.

The prototype of the get() function are as follows:

Here is an example how to specialize hi::selector for the my::simple type:

namespace my {
struct simple {
int foo;
};
}
template<>
struct hi::selector<my::simple> {
template<hi::fixed_string> auto &get(my::simple &) const noexcept;
template<> auto &get<"foo">(my::simple &rhs) const noexcept { return rhs.foo; }
template<> auto &get<"bar">(my::simple &rhs) const noexcept { return rhs.bar; }
};
This selector allows access to member variable by name.
Definition type_traits.hpp:691

The documentation for this struct was generated from the following file: