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

[question] What are the base class static member functions for? #341

Closed
dhebbeker opened this issue Mar 10, 2020 · 4 comments
Closed

[question] What are the base class static member functions for? #341

dhebbeker opened this issue Mar 10, 2020 · 4 comments

Comments

@dhebbeker
Copy link
Contributor

I am recently working in particular with the modm timers. I noticed that they inherit form the GeneralPurposeTimer and / or the BasicTimer classes. The static member functions of those classes are not defined.

What are those declarations good for?

@salkinium
Copy link
Member

I assume these were just for having a clean API documentation interface and for inheriting common definitions from basic to general to advanced.
Maybe @ekiwi knows more?

@ekiwi
Copy link
Contributor

ekiwi commented Mar 11, 2020

Maybe @ekiwi knows more?

We used to do this in xpcc in order to document the interface (like concepts). This was never enforced by the compiler afaik. You can probably get rid of this if you want to.

@salkinium
Copy link
Member

Ah yes, so this was like a platform specific HAL interface, with C++20 they could be described as proper Concepts and thus actually compiler-enforced. C++20 will bring a lot of good refactoring to modm, there's so much really great stuff in it!

Did this answer your question? (and do you want to close this issue?)

@dhebbeker
Copy link
Contributor Author

Thank you everybody for answering my question.

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

No branches or pull requests

3 participants