TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

What's new in C++26 (part 1)

149 pointsby jandeboevrie8 months ago

18 comments

wsve8 months ago
I often feel that when C++ posts come up, the majority of commenters are people who haven&#x27;t deeply worked with C++, and there&#x27;s several things people always miss when talking about it:<p>- If you&#x27;re working in a large C++ code base, you are stuck working with C++. There is no migrating to something like Rust. The overhead of training your engineers in a new language, getting familiar with a new tool chain, working with a new library ecosystem, somehow finding a way to transition your code so it works with existing C++ code and isn&#x27;t buggy and adapts to the new paradigms is all extremely expensive. It will grind your product&#x27;s development to a buggy halt. It&#x27;s a bad idea.<p>- Every time a new set of features (e.g. reflection, concepts, modules, etc.) is released, people bemoan how complicated C++ continues getting. But the committee isn&#x27;t adding features for the sake of adding features, they&#x27;re adding features because <i>people are asking for them</i>, they&#x27;re spending years of their lives writing papers for the committee trying to improve the language so everyone can write better code. What you find horrifying new syntax, I find a great way of fixing a problem I&#x27;ve been dealing with for years.<p>- Yes, it&#x27;s a gross homunculus of a language. If I could switch our team to Rust without issues, I would in a heartbeat. But this is the beast we married. It has many warts, but it&#x27;s still an incredible tool, with an amazingly hard working community, and I&#x27;m proud of that.
评论 #41485433 未加载
评论 #41477384 未加载
评论 #41476288 未加载
评论 #41475890 未加载
jll298 months ago
C++ is a monster.<p>The 2026 proposal has some neat ideas (I like the ability for the developer to give a reasons for modifying behavior that may create otherwise cryptic error messages, for instance); but the more things one packs in there, the uglier, bloated the specs, and the more complicated and buggy compilers will be.<p>Once C with Classes was an experimental pre-processor to try out bringing in some Simula ideas into the C world. Today, C++ has become a language that changes dramatically every half a decade, where the main question is &quot;will it compile&quot; if you receive someone else&#x27;s code, and where even experienced developers cannot tell from compiler error messages what&#x27;s wrong (g++). The undoubtedly clever people who have been working on it have nevertheless committed war crimes in anti-orthogonality.<p>Tip: introduce a versioning mechanism like Rust has it, so that you are freed from the burden of having to be backwards-compatible.
评论 #41474227 未加载
评论 #41473269 未加载
评论 #41474136 未加载
pjmlp8 months ago
Exciting as it may be, to be fully available for portable codebases maybe around 2030, given the current velocity of compilers adoption of ongoing standards, even among the big three.<p>As of today, C++17 is the latest one can aspire to use for portable code, and better not making use of parallel STL features.
评论 #41472310 未加载
评论 #41473758 未加载
评论 #41474955 未加载
评论 #41474083 未加载
sohamgovande8 months ago
One major gripe I have with these C++ updates is that the proportion of codebases that <i>actually use</i> recent C++ features (cpp17, cpp20, cpp23) is very close to zero. The more and more esoteric this language becomes, the fewer people who can actually master it.<p>Source: I&#x27;ve been writing C++ for 8 years.
评论 #41472399 未加载
评论 #41472426 未加载
评论 #41473258 未加载
评论 #41472312 未加载
评论 #41473132 未加载
评论 #41472194 未加载
评论 #41472848 未加载
评论 #41485181 未加载
评论 #41472300 未加载
评论 #41474001 未加载
评论 #41473216 未加载
评论 #41476391 未加载
评论 #41472236 未加载
sixthDot8 months ago
&gt; if (auto [to, ec] = std::to_chars(p, last, 42))<p>I&#x27;m not into plusplus, however i&#x27;m curious. How the tuple get evaluated to a condition ? is that lowered to if `to &amp;&amp; ec` ?
评论 #41471955 未加载
评论 #41471912 未加载
omoikane8 months ago
User-generated static_assert messages would make it easier to build games that can be played entirely using compiler error messages. Something like this old IOCCC entry but nicer:<p><a href="https:&#x2F;&#x2F;www.ioccc.org&#x2F;years.html#1994_westley" rel="nofollow">https:&#x2F;&#x2F;www.ioccc.org&#x2F;years.html#1994_westley</a>
logicchains8 months ago
This doesn&#x27;t mention the most exciting thing coming: static reflection. Finally no need to manually implement printing or serialisation functions for every struct.
评论 #41472094 未加载
giancarlostoro8 months ago
Some of those features look like features I&#x27;ve been seeing in all major languages I use. They&#x27;re mostly ergonomic for the developer.
porphyra8 months ago
C++ is a funny chimeric creation that has absorbed some great modern ideas from Rust and other new language but needs to preserve compatibility with its antediluvian C heritage. You could write it in a very clean and somewhat safe modern style or in a familiar C-like style. We use modern C++ at work and, by embracing RAII, it really isn&#x27;t so bad.
alecco8 months ago
<a href="https:&#x2F;&#x2F;web.archive.org&#x2F;web&#x2F;20240907061007&#x2F;https:&#x2F;&#x2F;mariusbancila.ro&#x2F;blog&#x2F;2024&#x2F;09&#x2F;06&#x2F;whats-new-in-c26-part-1&#x2F;" rel="nofollow">https:&#x2F;&#x2F;web.archive.org&#x2F;web&#x2F;20240907061007&#x2F;https:&#x2F;&#x2F;mariusban...</a><p>It seems to be down.
rldjbpin8 months ago
how long before you reckon it would be widely adopted? i feel like the pace of revision (~3 years per standard) seems too fast.
SuaveSteve8 months ago
Regarding the delete feature, can one not just raise in C++ for a deprecated&#x2F;deleted function?
评论 #41473004 未加载
评论 #41474115 未加载
mckravchyk8 months ago
I for one started working on a new project in C++ rather than Rust. I think it&#x27;s unclear whether Rust is going to be the successor at this point. It&#x27;s probably never going to pick up in the games industry, QT is C++ (and Rust bindings will always be second class or they could end up unmaintained), has better compile times and is said to be undisputed when it comes to high performance. Obviously the tool for the job factor is most critical.<p>Career wise, many people are picking up Rust and almost no one is picking up C++, while experienced C++ devs either retire or switch to a higher level language due to landscape change. I would trust supply and demand to be in favour of C++ 10 years from now.<p>There are also attempts to make C++ more memory safe like Carbon[1] or Circle compiler [2]. If they succeed, why would anyone want to switch to Rust? Also Rust is not ideal for security from a different perspective - I think the lack of a package manager is one C++ strongest points. After working for 9 years with npm, you really appreciate that the dependency you install is usually just a single dependency (even an option for a single header file is common), when there&#x27;s a package manager, people will abuse it (like install a package with 3 dependencies of its own for something that could be 50 LOC copy-paste) and managing the security of the supply chain is nearly impossible (it will be a legal requirement soon in EU though).<p>Anyway, I wanted to ask. How is the contracting market looking in C++ world? I&#x27;m guessing it depends on the domain heavily? I&#x27;m mainly asking about QT and anything that would be desktop &#x2F; mobile apps &#x2F; systems programming except video games, but I&#x27;m curious in general.<p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;carbon-language&#x2F;carbon-lang">https:&#x2F;&#x2F;github.com&#x2F;carbon-language&#x2F;carbon-lang</a><p>[2] <a href="https:&#x2F;&#x2F;github.com&#x2F;seanbaxter&#x2F;circle">https:&#x2F;&#x2F;github.com&#x2F;seanbaxter&#x2F;circle</a>
binary1328 months ago
Reflection is awesome, it reminds me a lot of Zig’s comptime functionality.
评论 #41473983 未加载
wseqyrku8 months ago
Why they don&#x27;t just invest in carbonlang instead?
评论 #41474822 未加载
psyclobe8 months ago
C++, the sharpest knife in the drawer.
评论 #41474900 未加载
bun_terminator8 months ago
.
评论 #41473786 未加载
评论 #41471774 未加载
评论 #41471760 未加载
评论 #41471831 未加载
roenxi8 months ago
Leading with &quot;Specifying a reason for deleting a function&quot; then following up with &quot;Placeholder variables with no name&quot; did make me check the date of the article. It wasn&#x27;t April 1.<p>The standards committee are thorough in their mission to including everything and the kitchen sink in C++.
评论 #41472683 未加载
评论 #41472086 未加载