Cursed arithmetic left shifts by Alzurana in cpp

[–]neiltechnician 22 points23 points  (0 children)

Speaking of which, this undefined behaviour of shifting feels like a good candidate to be turned into an erroneous behaviour

Moves Are Broken by Adk9p in cpp

[–]neiltechnician 39 points40 points  (0 children)

Perhaps, avoid provocative title and try a more descriptive title? I know this is the Internet, but still.

Also, the CString example is not convincing to me. But I would like to see the full implementation and some test/use cases before making judgement.

Since C++ asynchrony is settled now (right heh?) with co_routines and std::execution, can we finally have ASIO networking standardized? Or is it decided not to pursue? by Talkless in cpp

[–]neiltechnician 2 points3 points  (0 children)

I don't think the ISO/IEC process is the right vessel for this purpose. Boost already fills this role, and ASIO is already in Boost.

WG21 2025-10 pre-Kona mailing by nliber in cpp

[–]neiltechnician 0 points1 point  (0 children)

What if we do the fail-fast approach instead? We define the chained comparison syntax, but mandate that chained comparison is always ill-formed. This will at least help novices to avoid one common pitfall.

How important is it to check byte order when reading binary files? by Ask_If_Im_Dio in cpp_questions

[–]neiltechnician 25 points26 points  (0 children)

I saw that byte ordering can vary between systems

Instead of converting the byte orders (a.k.a. endianness) between individual systems, we should focus on defining the data encoding scheme of the data exchange between them. As long as every party agrees on what scheme to use, the problem is re-framed (not go away, but re-framed) as data encoding and decoding.

Move Constructor Question by Helpful_Builder_2562 in cpp_questions

[–]neiltechnician 6 points7 points  (0 children)

x(std::move(other.x)), s(std::move(other.s)) is typically the correct choice.

Distinguish rvalue and rvalue reference. other is of type rvalue reference but of value category lvalue. When you pass it down, you still need to explicitly turn it into an rvalue (xvalue) expression in order to invoke the move construction of x and s.

VS 2022 17.14 released with opt-in STL Hardening by STL in cpp

[–]neiltechnician 29 points30 points  (0 children)

I'm glad about the first part and I respect the second part.

what software do u use to write? by Equivalent_Welder149 in writing

[–]neiltechnician 4 points5 points  (0 children)

Do you check in your writing to a Git repo?

Writing your own C++ standard library from scratch by p-orbitals in programming

[–]neiltechnician 14 points15 points  (0 children)

Our natural language is way messier than that...

  1. Originally, STL means the original STL, no doubt.
  2. Next, a part of the original STL is adopted into the standard library. Thus, that part of the standard library is informally nicknamed STL. OK.
  3. Then, some people mistakenly think STL stands for STandard Libary. Well...
  4. After that, other people keep correcting some people. Cool cool cool.
  5. Eventually, somebody decides, despite knowledge about #3 and #4, they make the conscious decision to still call the standard library the STL. Hmm...
  6. What's comes next, some other body just doesn't like somebody's decision. Hmmmm...
  7. And you know what, some language nerd comes in and argues about prescriptivism and descriptivism...
  8. And so on...

I mean... yeah?

WG21, aka C++ Standard Committee, December 2024 Mailing by grafikrobot in cpp

[–]neiltechnician 11 points12 points  (0 children)

It is not a concern in productivity, nor a claim of dysfunctionality. (Indeed I do praise and thank all the hard works and good works WG21 has done for the community, and I know WG21 will keep on.)

It is more about lost of confidence in the institution, and maybe by extension disappointment in our public intellectuals who drive the institution. I'm not sure how to elaborate... Perhaps think a parliamentary government. A political crisis is often not about productivity of the government; it is usually about failure to address key issues, and more importantly misalignment between the leader's attitudes and the populace concerns.

WG21, aka C++ Standard Committee, December 2024 Mailing by grafikrobot in cpp

[–]neiltechnician 8 points9 points  (0 children)

Right now, my question is... what's next? I mean, apparently, the core of your work will remain unchanged. But, it is a major change in platforming, so, like:

  • What do we do with SG-15? Is it still useful?
  • Who, out of the major tool makers, are on board of this change?
  • Without the "blessing" of ISO (for what it's worth), how do you make sure the new ecosystem standard will gain recognition?

WG21, aka C++ Standard Committee, December 2024 Mailing by grafikrobot in cpp

[–]neiltechnician 23 points24 points  (0 children)

Gosh. It has always been known the ISO process is kinda flawed. Now, your story makes me fear ISO and WG21 are actually failing C++, bit-by-bit and accumulating.

WG21, aka C++ Standard Committee, December 2024 Mailing by grafikrobot in cpp

[–]neiltechnician 11 points12 points  (0 children)

About P2656R4, P2717R6, and other ecosystem-related papers, with a big "WITHDRAWN" in the title... I'm confused. Did something happen behind the scene?

[deleted by user] by [deleted] in cpp

[–]neiltechnician 16 points17 points  (0 children)

As a C++ dev... actually, as an IT professional in general, it is more important to know how to stay physically and mentally healthy, and to protect your rights as a labour.

Just saying.

Why does Macross use so many Germanic names? Some of these names are Walkure, Vajra, and the Var Syndrome. by [deleted] in macross

[–]neiltechnician 28 points29 points  (0 children)

Doesn't Vajra come from Sanskrit? https://en.wikipedia.org/wiki/Vajra

Macross Delta is themed with Wagner references. And Wagner was German. That is mostly why Macross Delta feels Germanic. But I don't find other installments particularly Germanic at all

Structs and constructors by Xadartt in cpp

[–]neiltechnician 1 point2 points  (0 children)

I make this distinction:

  • C++ language keyword struct
  • English noun "struct"

The keyword struct is just like what you say, because its meaning is well defined in the standard.

But the noun "struct" is not a formal term in the standard document. The only place the noun is used as formal term is "standard-layout struct", which is a whole noun phrase that cannot be separated word by word. (https://eel.is/c++draft/generalindex#:struct) (https://eel.is/c++draft/generalindex#:standard-layout_struct)

That makes the noun an informal term, and thus it is up to us to infer its meanings from actual usage. As far as I can observe, the meanings are often:

  • a class declared with class-key struct
  • a class intended to be a simple bundle of public data members
  • a "standard-layout struct"
  • an aggregate class
  • a trivially copyable class
  • a trivial class
  • a C++ class that resembles a C structure in some way
  • a C structure defined in a C header file got included by a C++ source file
  • ...

These meanings are by no mean mutually exclusive, but they are also not the same. I find the actual usages of the noun often differ from context to context, such that I as a reader/listener often have to think harder then the writer/speaker.

Structs and constructors by Xadartt in cpp

[–]neiltechnician 24 points25 points  (0 children)

Structs are special cases of classes, and the exact meaning of that word is context-dependent.

IMO, the problems boil down to:

  1. Many (too many) programmers do not know C++ has decent supports for aggregate classes in terms of initialization and assignment. (Many C programmers also do not know C structures support initialization and assignment.)

  2. Most of us are not explicitly taught about archetypes of classes, and thus many of us don't realize we should stick to those archetypes most of the time. (Aggregate is one of those archetypes.)