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

Provide interoperability between std::chrono::duration and boost::units::quantity<time> #51

Open
jpo234 opened this issue Apr 12, 2021 · 1 comment

Comments

@jpo234
Copy link

jpo234 commented Apr 12, 2021

The time dimension is special in C++, because there already is an implementation in the standard libraries: std::chrono::duration.
I think boost::units should recognize this and provide an easy way to convert between these two different implementations of what is basically the same thing.
Ideally one should be able to do:
quantity<time> q = 2h;
where 2h is a std::literals::chrono_literals::operator""h.

@correaa
Copy link

correaa commented Apr 13, 2021

Yes, one problem is that chrono is based on integer value types while Boost.Units, is generally based around floating point values. But I would also like something in this direction.

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