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

getTimeStamp signature #212

Open
fl4p opened this issue Mar 9, 2023 · 1 comment
Open

getTimeStamp signature #212

fl4p opened this issue Mar 9, 2023 · 1 comment

Comments

@fl4p
Copy link

fl4p commented Mar 9, 2023

Hi,
thanks for this lib.

Signature of getTimeStamp(struct timeval *tv, int secFracDigits) should be
getTimeStamp(const struct timeval *tv, int secFracDigits), so we don't have to cast away the const when using this func externally.

Or even better, consider using references to match the general C++ style:
getTimeStamp(const struct timeval &tv, int secFracDigits)

@vlastahajek
Copy link
Collaborator

Thanks, @fl4p, for the feedback.
I admit there should be the const qualified before struct timeval *tv.
However, its usage should stay idiomatic. As the struct timeval is from C time API, it is mostly used as a pointer and it is better to keep it so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants