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

align the row / col parameters #175

Open
2 of 3 tasks
MCWertGaming opened this issue Aug 19, 2022 · 2 comments
Open
2 of 3 tasks

align the row / col parameters #175

MCWertGaming opened this issue Aug 19, 2022 · 2 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@MCWertGaming
Copy link
Collaborator

MCWertGaming commented Aug 19, 2022

Currently it's really hard to figure out whether the function takes (row, col) or (col, row) as argument which is really confusing. Also I have noticed a few other things that don't work out that well:

@MCWertGaming MCWertGaming self-assigned this Aug 19, 2022
@MCWertGaming MCWertGaming added the enhancement New feature or request label Aug 19, 2022
@MCWertGaming MCWertGaming added this to To do in CPP-Terminal via automation Aug 19, 2022
@MCWertGaming MCWertGaming added this to the V1.0.0 milestone Aug 19, 2022
@MCWertGaming MCWertGaming moved this from To do to V1.0.0 in CPP-Terminal Aug 19, 2022
@flagarde
Copy link
Collaborator

Hi, maybe returning a class with width weigth would be better ?

And use std::size_t windows is complaining about int to size_t convertion and size_t seams really a good type for a size of a window

@MCWertGaming
Copy link
Collaborator Author

A class?

std::tuple is basically what rust, GO, many others use, like

std::tuple<size_t, size_t> get_term_size() {
  return std::tuple<size_t, size_t>(width, hight)
}

int main() {
  auto width, height = get_term_size();
}

Most C++ libraries do that for multiple returns because it's parts of C++17

For the size_t and int conversion: Yeah I have had those problems too, idk why int was used, especially because it will cause a lot of problems on big screens (size_t is a uint64_t, while int is int32_t).

@MCWertGaming MCWertGaming moved this from V1.0.0 to In progress in CPP-Terminal Aug 23, 2022
@MCWertGaming MCWertGaming moved this from In progress to next up in CPP-Terminal Aug 23, 2022
@MCWertGaming MCWertGaming moved this from next up to Pull-Requests in CPP-Terminal Sep 16, 2022
@MCWertGaming MCWertGaming moved this from Pull-Requests to In progress in CPP-Terminal Sep 16, 2022
@MCWertGaming MCWertGaming moved this from In progress to V1.0.0 in CPP-Terminal Sep 16, 2022
@MCWertGaming MCWertGaming moved this from V1.0.0 to next up in CPP-Terminal Sep 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: next up
Development

No branches or pull requests

2 participants