How to correctly and elegant implement the apply function for structured binding?
In the std namespace, there is a convenient std::apply
function that allows you to perform an action on each element of the tuple. Using structured binding, we can achieve the same behavior for non-tuple types. Suppose we consider a type with only one non-static data member. Therefore, I wrote the following code:
How to correctly and elegant implement the apply function for structural binding?
In the std namespace, there is a convenient std::apply
function that allows you to perform an action on each element of the tuple. Using structural binding, we can achieve the same behavior for non-tuple types. Suppose we consider a type with only one non-static data member. Therefore, I wrote the following code: