Skip to main content
The 2026 Annual Developer Survey is live— take the Survey today!
Filter by
Sorted by
Tagged with
Filter by Employee ID
Score of -6
0 answers
49 views

If they already know all files in a directory belong to the same package, why not remove package declarations entirely?
Score of 1
2 answers
234 views

Triggered by this question I was reading about out of bounds access via std::span::operator[] here: If idx < size() is false, the behavior is undefined.(until C++26) Why is it specified ...
Score of 6
3 answers
880 views

As C++26 standard's timeline is getting near, I want to know: What are the reason(s) for no built in support of networking in the C++ standard. That is, what exactly are the problems that lead to ...
Best practices
1 vote
1 replies
47 views

In designing a language from scratch, should methods use a self variable to access properties and other methods? Or should they imply their target with .prop? Or should they treat properties as local ...
Score of 6
1 answer
215 views

I am new to Rust and one thing that stands out to me is that in Rust, constness/mutability is not bound to the type, but to a particular variable. So, it seems to me like it would be impossible in ...
Score of 1
1 answer
199 views

This code is rejected by all compilers I could test it on, so I suppose it is ill-formed according to the standard. struct X { void f(); }; void (X::*fptr)() & = &X::f; // ERROR Here we ...
Score of 59
1 answer
5070 views

In C and C++, the expression some_num & 0xABCD == 5 will effectively evaluate as some_num & (0xABCD == 5). This is unlike all of the standard arithmetic operators, as they have higher ...
Score of 4
1 answer
267 views

Why were char8_t, char16_t, char32_t designed as built-in types, but std::byte was not? As per the C++ philosophy, if something can be implemented in the library, we almost always prefer doing so to ...
Score of 0
1 answer
199 views

In short, I'm trying to understand why copying, which is such a fundamental thing in C++ (fundamental in the sense that you, as the programmer, have quite a lot of power in writing code to permit or ...
Score of 33
2 answers
1761 views

Apparently you can =delete virtual functions: struct A { virtual void foo() = delete; }; struct B : A { void foo() override = delete; }; Interestingly, both functions have to be =deleted, or ...
Score of 5
1 answer
452 views

I know for sure how to calculate a cross product myself, but usually I tree to use the standard library where possible. I am aware that std::linalg is still in development so this might already be the ...
Score of 0
2 answers
296 views

Here is the error in GCC (which i have already fixed): ISO C++ forbid taking the address of a bound member function to form a pointer to member function This is the error line of my code: threads[i] ...
Score of 0
2 answers
214 views

When the virtual keyword is applied to a method the whole class becomes abstract. Shouldn't the virtual or abstract keyword be applied to the class? It is a more intuitive design because it reflects ...
Score of 13
1 answer
537 views

C++23 allows to define a lambda as static. i.e. If a lambda captures nothing, then it can be defined as static: // with superfluous argument `this`, less efficient. auto fn1 = [](int a, int b) { ...
Score of 4
1 answer
186 views

I'd have expected that if an std::array is an rvalue, then calling operator[] returns an rvalue as well. But it doesn't seem to be the case (cppreference), there are no value-category overloads. For ...

15 30 50 per page
1
2 3 4 5
99