Skip to content

Conversation

@chiphogg
Copy link
Member

We add support for Magnitude, Constant, and SymbolFor.

In the test, including speed_of_light.hh felt easier than defining a
new version of the speed of light constant. This brought in the
authoritative definition of Seconds, so we deleted our ad hoc
definition. In general, it would be nice to clearly articulate a policy
as to which header files we want to let ourselves use in which test
files: there's a tension between convenience, and keeping dependencies
clean. But this is fine for now.

Fixes #378.

We add support for `Magnitude`, `Constant`, and `SymbolFor`.

In the test, including `speed_of_light.hh` felt easier than defining a
new version of the speed of light constant.  This brought in the
authoritative definition of `Seconds`, so we deleted our ad hoc
definition.  In general, it would be nice to clearly articulate a policy
as to which header files we want to let ourselves use in which test
files: there's a tension between convenience, and keeping dependencies
clean.  But this is fine for now.

Fixes #378.
@chiphogg chiphogg added the release notes: ✨ lib (enhancement) PR enhancing the library code label Jan 19, 2025
// Streaming support for Magnitude: print the magnitude label.
template <typename... BPs>
std::ostream &operator<<(std::ostream &out, Magnitude<BPs...> m) {
return (out << mag_label(m));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are the parens needed here or is it a style?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know whether they're needed; it was a stylistic choice.

@chiphogg chiphogg merged commit 417dc07 into main Jan 21, 2025
14 checks passed
@chiphogg chiphogg deleted the chiphogg/stream-mag-const-symbol#378 branch January 21, 2025 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release notes: ✨ lib (enhancement) PR enhancing the library code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support streaming output for more types

3 participants