-
Notifications
You must be signed in to change notification settings - Fork 96
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
feat: quantity_kind and quantity_point_kind #204
Conversation
I still need to deal with You'll notice that I chose to actually instantiate stuff rather than just checking their signature with type traits/concepts/require clauses. That's what led me to find the inconsistencies in (lack of) warnings. Similarly, I test the validity of individual expressions in the tests' concepts. Remember when |
a39818e
to
3523980
Compare
Just as a reminder |
{ | ||
return formatter<Q>::format(v.magnitude(), ctx); | ||
return formatter<typename QK::quantity_type>::format(v.common(), ctx); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By the way, I got this when using fmt
's master
branch. The quantity
formatter uses a removed fmt::detail::
name.
../../../example/glide_computer.cpp:144:17: required from ‘void {anonymous}::print(const R&) [with R = std::array<{anonymous}::glider, 4>]’
../../../example/glide_computer.cpp:380:16: required from here
/home/johel/Documents/C++/Forks/mpusz/units/src/src/include/units/format.h:91:73: error: ‘make’ is not a member of ‘fmt::v7::detail::fill_t<char>’
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, that was using my system-wide fmt
, the latest stable release at the time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be fixed now with f9b15dd
cd9580c
to
8402d95
Compare
Can you confirm that this supports |
f9bba80
to
a3d415b
Compare
a3d415b
to
97b9346
Compare
I agree with #100 (comment). I'll be removing those. I started using this PR, and instead of |
97b9346
to
2b58ef9
Compare
I have taken a liking to doing something like inline constexpr variable_definition<width> w{};
template <units::basic_fixed_string> auto operator""_v();
template <> auto operator""_v<"λ">() { return variable_definition<wavelength>{} };
f(w = 42 * m);
g("λ"_v = (42 * m / s) / (42 * Hz)); It is meant to mirror the lhs of math formulas. And to make quantity kind creation less verbose, similar to unit constants. Would you be opposed to having something like this? |
2b58ef9
to
dd88648
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WOW, this is HUGE!!! :-D
Thank you so much!!!
{ | ||
return formatter<Q>::format(v.magnitude(), ctx); | ||
return formatter<typename QK::quantity_type>::format(v.common(), ctx); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be fixed now with f9b15dd
Now we need some docs 😉 |
What exactly? The PR did include some, mirroring |
Sorry, my fault. The docs were there but they were not added to TOC. |
I thought I had done it: I see now that there's some repetition involved. Perhaps using |
Agree, we could try to setup |
The more documentation in the PR, the more likely that is. |
Isn't it easier to build and fix the docs locally? For example, what is the reason you are not doing so? Please note that some time ago I added |
I think it may have been the struggle of using a new tool, namely Conan, in the past. I'll try it again, though. |
Thanks, just follow https://mpusz.github.io/units/usage.html#contributing-or-just-building-all-the-tests-examples-and-documentation. And please let me know in case of issues. |
Resolves #173.
Partially addresses #172.
Resolves 3239186#r45824165.