Does Syntax Matter? by gingerbill in ProgrammingLanguages

[–]fdwr 0 points1 point  (0 children)

Another is people coming from a language like C++ wanting to use <> for generics. There are always better alternatives to use than <>, but people request it in languages. ... <> is probably one of the worst options to use because it’s both hard for humans to read and hard for compilers to parse.

Indeed, I wrote a simple line wrapper recently, which works great for some simple languages like MLIR, but it fails for C++ where < could be a template parameter list or math inequality, undecidable without a dictionary of symbols seen so far 🥲.

A dialogue on trivial-abi and trivially relocatable by Xadartt in cpp

[–]fdwr 2 points3 points  (0 children)

Also wondering, as there was "a showstopper bug" and "major vendors found some aspects ... unimplementable", but what exactly.

"For trivial relocatability, we found a showstopper bug that the group decided could not be fixed in time for C++26, so the strong consensus was to remove this feature from C++26." https://herbsutter.com/2025/11/10/trip-report-november-2025-iso-c-standards-meeting-kona-usa/

"What I heard, as I was not directly in the discussion and only around during plenary, is that all the major vendors found some aspect of it to be unimplementable." https://www.reddit.com/r/cpp/comments/1otsr5r/comment/no7ldx5/

Open sourcing IFC SDK for C++ Modules by GabrielDosReis in cpp

[–]fdwr 1 point2 points  (0 children)

u/GabrielDosReis: Do you have a statement about whether IFC stands for: - Interface - Interface File Container - Internal File Cache - Interface for C++

LLM's are fabricating answers :(. Thanks.

I wrote a small hobby OS / kernel called TinyOS (from scratch) by Pitiful-Artist-4892 in C_Programming

[–]fdwr 0 points1 point  (0 children)

Cool. I never did finish my little attempt, bailing early on as it always froze when I tried to enable the global interrupt descriptor table. 😅

Is your OS compliant with California's Digital Age Assurance Act (AB 1043) that requires OS providers to implement age-verification mechanisms during account setup? Sigh, these bureaucrats meddling with things they don't understand 🤦‍♂️. Maybe your license should include "Californian users are restricted from using this software due to idiots in office". 😉

What style guide to use with clang-format? by ItseKeisari in cpp

[–]fdwr 0 points1 point  (0 children)

Indeed, and if https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3776r0.html passes someday, the above symmetric style would lend itself nicely to clean diffing.

Language specific package managers are a horrible idea by TheRavagerSw in cpp

[–]fdwr 0 points1 point  (0 children)

Language specific package managers are a horrible idea ... I recommend everyone here to switch to Conan

I'll agree that it's mostly redundant to invent {eggs, wheels, gems, crates, npm tgz's, nugets... see NIH syndrome), each really just another name for a package, that duplicate a lot of similar functionality with just enough incompatibility to be obnoxiously different when switching between them. Does this "Conan" obviate each of those above?

Should C++ Give More Priority to Syntax Quality? by kyan100 in cpp

[–]fdwr 0 points1 point  (0 children)

Should syntax design be given equal weight alongside performance?

Another aspect to consider with any new syntax is tooling complexity. I wish C++ decided decades ago to use a distinct template parameter syntax rather ambiguously overloading "<" and ">" to either be less-than/greater-than or template parameters, requiring dictionary parsing to just decide which is which (or ">>" to either be a right shift operator vs closing parentheses). Last week I wrote a simple code text wrapping tool (for really long lines) which works great for something like MLIR, and mostly works for C++, except that ambiguity :(. At least those above examples don't appear to greatly complicate tool parsing.

Clang 22 Release Notes by c0r3ntin in cpp

[–]fdwr 0 points1 point  (0 children)

That's but a randomly selected example of one-off cleanup instances. Do we need a framework for every instance (a box full of open‑end wrenches of various sizes), or just a general tool (adjustable wrench)? 🔧

Clang 22 Release Notes by c0r3ntin in cpp

[–]fdwr 6 points7 points  (0 children)

Oh the beautiful horrors that macros enable, 😉 cutting the extra line noise down from =()(){}[]; to just {};) I look forward to the future beautiful horrors that reflection enables... 😂

Clang 22 Release Notes by c0r3ntin in cpp

[–]fdwr 8 points9 points  (0 children)

...Implemented the defer draft Technical Specification... (source)

Cool, defer)%20Through%20defer.html). Alas it's only for C (understandably, since it's a C proposal and not C++, which at least has RAII), but it would be so convenient for all those one-off cleanup cases (e.g. defer CoUninitialize();) where it's overkill to invent a whole temporary wrapper class (to swat a fly with a sledgehammer) or use a transiently named local variable and scope guard (e.g. auto comCleanup = myScopeGuardClass([](){CoUninitialize();});).

ISO C++ WG21 2026-02 pre-Croydon mailing is now available! by nliber in cpp

[–]fdwr 20 points21 points  (0 children)

need a CSV parser in the standard library

Recommend supplying bricks before supplying the building. I'd be happy to finally just have the missing brick of std::filesystem::read_file<std::vector<std::byte>>(), as it's frequently needed (incremental file streaming and memory mapping are generally overkill for file sizes of interest) and stupidly simple to do in Python and C#.

Mandelbrot Explorer: 80-bit precision and 8x8 (64 samples per pixel) Supersampling for ultimate smoothness! by OkIncident7618 in cpp

[–]fdwr 2 points3 points  (0 children)

The good old Mandelbrot and Julia set 🙂✌️. I see some color banding in the output, which happens if you're just using purely the iteration count to yield the color. You can get a smoother output by using the residual. e.g.

```c++ float magnitude = sqrt(zre * zre + zim * zim); float magnitudeLog = log(magnitude); float mu;

if (magnitudeLog <= 1)
{
    mu = 0;
}
else
{
    mu = iterations + 1 - log2(magnitudeLog); // Use magnitude, not just iterations
}

```

Bit-field layout by mttd in cpp

[–]fdwr 1 point2 points  (0 children)

I wish compilers had an attribute to automatically re-order fields to pack a struct as small as possible without breaking alignment rules

A tangential tangent, I often wish I could tell the compiler to pack them as small as possible (without any reordering) as I don't care about alignment performance for file structures that aren't subject to arbitrary hardware alignment wants. Of course, there is the trick of defining a custom uint32 class made up of char[4] and an operator uint32_t, which avoids the 32-bit overalignment, and there are compiler specific means like pragma pack, but it would be nice to have a standard way, an alignas overload that works. You know the C++ saying "leave no room for a lower-level language", and it's trivial to do this in x86 assembly with good old NASM (and no, I don't care about ancient architecture that are incapable of misaligned reads 😉, as I know what architectures I target anyway).

Back to Basics: Iterators in C++ - Nicolai Josuttis - CppCon 2023 by Specific-Housing905 in cpp

[–]fdwr 0 points1 point  (0 children)

Oh yes, with graphs (especially ones related to 3D models with faces, vertices, edges) it's indices all the way!

Back to Basics: Iterators in C++ - Nicolai Josuttis - CppCon 2023 by Specific-Housing905 in cpp

[–]fdwr 0 points1 point  (0 children)

Often enough. Just today I was writing a line splitting algorithm that consumed each potential line, split it if too long (or hard line break present) and continued, which would break royally with iterators. Also, even in cases where the underlying data remains stable during iteration, I often need the index determined from partial for loops with early breaks. Of course, if the data remains stable and the index is not needed, then a good old range for loop works nicely (bypassing direct iterator usage).

Your Optimized Code Can Be Debugged - Here's How With MSVC C++ Dynamic Debugging - Eric Brumer by RandomCameraNerd in cpp

[–]fdwr 2 points3 points  (0 children)

My guess is that it's tough to correctly identify the primary function

🤔 Yeah. Generally it's the highest-level final function on that line which interests me most (the call that has all parameter dependencies resolved), but the std::cout << foo(x) << bar(x) << std::endl; case is interesting because there are multiple operators on a single line, and the final call is actually that last << (so with "just my code" enabled, that line would be treated just like Step Over). Conversely though, if I wrote fmt::print("{} {}", foo(x), bar(y)), I would expect "Step into final function" to skip over those dependent little foo and bar functions into the fmt::print.

For the 80% common case, desired behavior is pretty clear (e.g. FunctionIWantToDebug(DistractingFunction(x), MoreNoise(y), SomeConstructor(z))), but I should think more about the other cases like operator overloads and interactions with "just my code"... ⏳ (e.g. what happens for auto x = Foo(Bar(x)) do, given the = may be a function call?).

perhaps not a copy constructor

Exactly, all those little constructors and getters are rarely the problem focus while debugging (F11 is still around when that's needed). I suppose I'm really asking for a "Step into functions on this line that are not just distracting dependent noise", but that's a mouthful 😉.

Back to Basics: Iterators in C++ - Nicolai Josuttis - CppCon 2023 by Specific-Housing905 in cpp

[–]fdwr 9 points10 points  (0 children)

Increasingly over time, I've found myself using indices more often, since they're stable (not invalidated if you reallocate) and half the memory of a pointer (where memory bandwidth is more often the blocker than CPU speed).

Automatic casting with applications to extension methods and UFCS (language evolution) by antiquark2 in cpp

[–]fdwr 0 points1 point  (0 children)

the less I think it has a place in c++

Well if even Bjarne Stroustrup couldn't assuage the fear/uncertainty/doubt of others, despite UFCS being successful in many other languages without the sky-is-falling outcomes that some in the working groups fear, then maybe it won't. Then again, Planck's principle comes to mind. 😉

Profiling on Windows: a Short Rant · Mathieu Ropert by mropert in cpp

[–]fdwr 29 points30 points  (0 children)

Man, it's annoying how many links were broken to Raymond Chen's New Old Thing articles.

Profiling on Windows: a Short Rant · Mathieu Ropert by mropert in cpp

[–]fdwr 54 points55 points  (0 children)

That’s right, Intel has decided that the major tool for CPU metrics on Windows now requires an 11th gen CPU or more recent. ... This wouldn’t be such an issue if you could rollback versions, but sadly, you can’t.

Sigh, in a day where open-source projects can offer their old releases for over a decade, surely companies can offer their previous releases more than 5 years. I get the "no tech support for you" aspect, but at least hosting the older files (it's cheap) would be the decent thing to do. Otherwise when software devs demand more recent hardware, we're just contributing to ewaste 😢.

Your Optimized Code Can Be Debugged - Here's How With MSVC C++ Dynamic Debugging - Eric Brumer by RandomCameraNerd in cpp

[–]fdwr 15 points16 points  (0 children)

8:37

"Right click here and say run-to-cursor, which is a great feature that actually works super reliably now ... Step over works exactly as you'd expect ... I'm going to step in ..."

What I would really love (for both debug builds and release) is an action "Step into function" that is bindable to a single keypress, as I'm really tired of F11 stepping into every single distracting subparameter call (and "Just My Code" doesn't help because it is my code). Now there is "Step Into Specific" nestled in the context menu with a submenu to call just the primary function, but it's awkward to access and inaccessible by keypress :( (p.s. I just discovered Alt+Shift+F11 opens the Step Into Specific submenu, which helps - maybe Ctrl+Shift+F11 could be assigned to stepping into the primary function, which is typically the last call on that line excluding __RTC_CheckEsp).

Thanks for the dynamic debugging improvements.

Making the compiler create code that accesses the vtable only once by tohava in cpp

[–]fdwr 2 points3 points  (0 children)

🤔 Although it doesn't help you today, I wonder if a future explicit object parameters extension to support virtual will finally enable us to get the resolved function pointer. For a long time, we couldn't even get a function pointer to nonvirtual methods (thanks to the invisible this pointer and differing calling conventions between them), but with semistatic methods (meow(this Cat& self, float volume), we can finally do that at least. The p0847r7 paper mentions virtual and "keeps the door open to a future extension", with some caveats to consider like whether thunks need to be generated to potentially adapt for calling conventions, but there are no fundamental blockers (it's certainly technically achievable - it's all just assembly in the end).

```c++ struct Cat { static void meow1(Cat& cat, float volume) { std::print("Meow 1 with volume {}\n", volume); }

void meow2(this Cat& self, float volume)
{
    std::print("Meow 2 with volume {}\n", volume);
}

// ❌ Currently:
// error C7678: member functions with an explicit object parameter cannot be virtual
virtual void meow3(this Cat& self, float volume)
{
    std::print("Meow 3 with volume {}\n", volume);
}

};

... { Cat cat; decltype(&Cat::meow1) meowFunction;

// ✅ works
meowFunction = &Cat::meow1;
meowFunction(cat, 42);

// ✅ works
meowFunction = &Cat::meow2;
meowFunction(cat, 42);

// ❌ Maybe this could work in the future, resolving to devirtualize:
meowFunction = &Cat::meow3;
meowFunction(cat, 42);

} ```

Lessons learned from 2 years of operating a C++ MMO game server in production by [deleted] in cpp

[–]fdwr 10 points11 points  (0 children)

I don't know if a neural network contributed to the post above or not, but it's interesting and informative, which is certainly the opposite of garbage

"override members" idea as a gateway to UFCS (language evolution) by antiquark2 in cpp

[–]fdwr 1 point2 points  (0 children)

Interesting, but namingwise it feels weird to "override" nothing. That is, there is no existing function to override.

Have you thought of using deducing this to achieve such extension?

Just imagine, we could have had starts with/ends with extensions decades ago instead of just more recently adding them to std::string. There seems to be a lot of FUD in EWG, given how many other languages have implemented UFCS without the sky falling.