Use fold expression in ostream impl#351
Merged
nholthaus merged 1 commit intonholthaus:v3.xfrom Dec 15, 2025
Merged
Conversation
Just wanted to double check here: v3.x has a minimum standard version of C++17 according to the README, right? I find the C++23 comment very surprising. |
Owner
|
I need to update the readme. There are concepts and some template alias
argument deduction in the latest v3 from c++23.
…On Mon, Dec 15, 2025, 2:37 PM Chip Hogg ***@***.***> wrote:
*chiphogg* left a comment (nholthaus/units#351)
<#351 (comment)>
v3.x targets C++23 and higher
Just wanted to double check here: v3.x has a minimum standard version of
C++17 according to the README
<https://github.com/nholthaus/units/tree/v3.x>, right? I find the C++23
comment very surprising.
—
Reply to this email directly, view it on GitHub
<#351 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACOYOH6WOUZIOEXNMJ3HKQT4B4EWDAVCNFSM6AAAAACOZQOV5KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTMNJXGI4DCOJTHA>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fold expressions were introduced in C++17, and v3.x targets C++23 and higher, so this should be fine.
I considered updating
is_linear_scaleandis_decibel_scaleto also use fold expressions, but since those usestd::bool_constant, it didn't end up being more expressive. (I'd have to wrap the fold expression instd::bool_constant<()>, which adds more clutter)