Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

std::tuple_size / tuple_element specializations for Corrade containers #157

Closed
5 tasks
mosra opened this issue Nov 12, 2022 · 1 comment
Closed
5 tasks

Comments

@mosra
Copy link
Owner

mosra commented Nov 12, 2022

Revived from #127. For C++17 auto [a, b] = someType;, among others:

  • Containers::Pair, for which the std::tuple_whatever specializations could go into the already-existing Containers/PairStl.h, and a corresponding new C++17-only PairStlCpp17Test.cpp
  • Containers::Triple, for which the std::tuple_whatever specializations could go into the already-existing Containers/TripleStl.h, and a corresponding new C++17-only TripleStlCpp17Test.cpp
  • Containers::StaticArrayView, for which it could go into the already-existing Containers/ArrayViewStl.h, and a corresponding new ArrayViewStlCpp17Test.cpp
  • Containers::StaticArray, into a new StaticArrayStl.h header, and a new StaticArrayStlCpp17Test.cpp as well

The assumption is that there will be more and more C++14/17/20-specific features, so the ton of new files is fine.

The std::tuple_element / std::tuple_size is a C++11 feature already so I wouldn't hide them in any #if compiling_as_cpp17. Having them exposed unconditionally would mean std::get<N>() working with Corrade/Magnum types even under C++11, for example.

  • Maybe it would make sense to test them directly in C++11 test files somehow, instead of C++17-only tests that won't be run on half the CI jobs. Like, for example, just trying to call std::get<N>() on them, and if that works, the C++17 structured bindings should work too.

And for Magnum a similar treatment would be done for Math::Vector and possibly other math types, in a similar way.

@mosra mosra added this to the 2023.0a milestone Dec 8, 2023
@mosra mosra added this to TODO in Containers via automation Dec 8, 2023
@mosra
Copy link
Owner Author

mosra commented Dec 8, 2023

Done in 5f4fc52, together with structured bindings for StridedDimensions.

@mosra mosra closed this as completed Dec 8, 2023
Containers automation moved this from TODO to Done Dec 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Containers
  
Done
Development

No branches or pull requests

1 participant