Structure binding support
It would be nice to have C++17's structure binding support for StaticVector
and StaticMatrix
, where the former decomposes a StaticVector
into scalars and the latter decomposes a StaticMatrix
into row vectors.
This requires partially specializing std::tuple_size
and std::tuple_element
.
Comments (9)
-
-
reporter Godbolt code: https://godbolt.org/z/ir22Nb
-
-
assigned issue to
-
assigned issue to
-
- changed status to open
-
- changed status to resolved
Commit a5c3942 adds structure binding support for the
StaticVector
class template. The feature is immediately available via cloning the Blaze repository and will be officially released in Blaze 3.6. -
reporter I just noticed that a5c3942 will not work as-is:
class
usesprivate
as default access modifier;struct
usespublic
as default access modifier.
I also noticed (to my surprise) at https://en.cppreference.com/w/cpp/utility/tuple/tuple_size, that the template class uses
class
. Soclass
is indeed the better choice for the partial template specializations. -
-
reporter Right, but then you need to make both the inheritance and member type alias
public
? -
- Log in to comment
Hi Matthias!
This sounds like a reasonable addition to
StaticVector
andStaticMatrix
. We will consider this in one of the next releases of Blaze. Alternatively, if you have the time, you could also provide the necessary specializations in form of a pull request. Thanks for creating this issue,Best regards,
Klaus!