-
Notifications
You must be signed in to change notification settings - Fork 167
Closed
Description
#ifdef _STR
# error _STR already defined
#endif
#define _STR(S) BOOST_METAPARSE_STRING(S){}
struct gps_position
{
field<int, (name=_STR("degrees"))> degrees;
field<int, (name=_STR("minutes"))> minutes;
field<float, (name=_STR("seconds"))> seconds;
};
We need to:
field<T, A>template class, this class is just a wrapper to T withstd::reference_wrapper-like(??) iface.nameobject with overloadedoperator=(std::string_view), and this overloaded operator must be constexpr
This short example:
https://godbolt.org/z/nT4bdrnKc
Interface of field_t<T,A> class is not ideal, but this short example shows that structure with named fields are possible.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels