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

STL: structs shouldn't redundantly say public for their base classes #218

Closed
StephanTLavavej opened this issue Oct 25, 2019 · 3 comments
Closed
Labels
enhancement Something can be improved fixed Something works now, yay! good first issue Good for newcomers

Comments

@StephanTLavavej
Copy link
Member

struct access control defaults to public for both members and base classes: https://eel.is/c++draft/class.access.base#2

Several years ago, we started following a convention in the STL of not repeating public for structs, but there are at least 21 places that need to be updated. One example:

STL/stl/inc/utility

Lines 409 to 413 in 6b0238d

template <size_t _Index, class _Tuple>
struct tuple_element<_Index, const _Tuple> : public tuple_element<_Index, _Tuple> { // tuple_element for const
using _Mybase = tuple_element<_Index, _Tuple>;
using type = add_const_t<typename _Mybase::type>;
};

The necessary change is simple:

-struct tuple_element<_Index, const _Tuple> : public tuple_element<_Index, _Tuple> { // tuple_element for const
+struct tuple_element<_Index, const _Tuple> : tuple_element<_Index, _Tuple> { // tuple_element for const

Find and fix as many as you can.

@StephanTLavavej StephanTLavavej added enhancement Something can be improved good first issue Good for newcomers labels Oct 25, 2019
@lozinska
Copy link
Contributor

Hello there! May I work on this issue?

@StephanTLavavej
Copy link
Member Author

Yes, go for it! 😸

@lozinska
Copy link
Contributor

Thank you

@StephanTLavavej StephanTLavavej added the fixed Something works now, yay! label Oct 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Something can be improved fixed Something works now, yay! good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants