WeSearch

C++26: Ordering of constraints involving fold expressions

·3 min read · 0 reactions · 0 comments · 25 views
#programming#cpp#software development
TL;DR · WeSearch summary

C++26 introduces a solution to the ambiguity issues in overload resolution involving fold expressions. The new concept of fold expanded constraints allows the compiler to properly recognize and prioritize more constrained overloads. This change addresses limitations present in C++20 and C++23 regarding constraint subsumption.

Key facts
How this story was covered

2 outlets in our directory ran this story, first to last over 8 hours. All of the coverage we found sits in one bucket: centre. That one-sidedness is itself worth noticing.

Centre · 1
About this source

Hacker News (Newest) files mainly under programming. We currently carry 5,306 of its stories.

Original article
Sandor Dargo’s Blog
Read full at Sandor Dargo’s Blog →
Story provenance
Source · retrieval · rights · ranking — open for full record
inspect →

Attribution is not the same as permission. This drawer separates discovery metadata, excerpts, WeSearch-generated summaries, reuse status, and whether the publisher receives the visit. Nothing here claims a legal grant the publisher has not made.

Record

Original publisherSandor Dargo’s Blog
Canonical URLhttps://www.sandordargo.com/blog/2026/05/27/cpp26-constraints-ordering-fold-expressions
Publication timeWed, 27 May 2026 15:24:49 +0000
Retrieval time2026-05-27T15:38:01.782Z
Last seen2026-05-27T15:38:01.782Z
Headline sourcePublisher (no WeSearch rewrite)
Excerpt sourcepublisher body
Excerpt methodFirst ~120 words (~800 chars) of extracted publisher body, fair-use limited.
SummaryWeSearch · cerebras-chat (WeSearch summarizer)
Summary source textcontentText
Citation coverageSummary is a WeSearch-generated derivative; primary citation is the original publisher URL.
ClusterT5FqfBXqOid9 · 2 stories
Cluster logicGrouped by semantic title/content similarity across sources within a rolling window. Same-publisher template collisions are excluded from coverage comparison.
Ranking reasonStory pages are not engagement-ranked. Hub feeds use recency, with optional source-diversified chronological ordering (cap consecutive stories per source). No personalized ranking.
Publisher visitYes — open original
Substitutes article?No — link-out required for full text

Rights status (four layers)

Publisher-declared
No publisher-confirmed rights record for this source yet.
Machine-readable
No source-specific machine-readable restriction detected beyond the public feed.
WeSearch interpretation
WeSearch declared handling (basis: Derived from the published RSS/Atom feed). This is WeSearch policy, not a legal grant on the publisher's behalf.
Unknown
Retrieval and training permissions are not asserted unless the publisher confirms them.

WeSearch handling by dimension

Indexing May the item be indexed (stored, ranked, made findable)? Allowed
Snippet May a short excerpt of the publisher's text be shown? Allowed
AI summary May WeSearch generate its own short summary of the article? Limited
Retrieval / RAG May the content be exposed for third-party retrieval-augmented generation? Not asserted
Model training May the content be used to train AI models? Not asserted
Commercial reuse May the content be reused commercially? Not permitted

Basis: Derived from the published RSS/Atom feed. Contact: [email protected]. Reviewed: 2026-07-24.

Opening excerpt (first ~120 words) tap to expand

You have two overloads of g(). One requires A<T> for each element in a pack, the other requires C<T> — where C is a stricter concept that subsumes A. Both apply to the types you’re passing. The compiler should pick the more constrained version. But instead it complains about an ambiguous call.This is a limitation of how C++20 and 23 handle constraints that use fold expressions — fixed in C++26.Constraint subsumption, brieflySubsumption is the compiler’s mechanism for ordering overloads by how constrained they are. If concept C is defined as A && B, then any type satisfying C also satisfies A. The compiler recognizes this and, when resolving an overload, prefers the more constrained one — no ambiguity.As we saw a few years back, subsumption has quirks.

Excerpt limited to ~120 words for fair-use compliance. The full article is at Sandor Dargo’s Blog.

Anonymous · no account needed
Share 𝕏 Facebook Reddit LinkedIn Threads WhatsApp Bluesky Mastodon Email

Discussion

0 comments