No idea how it works in other countries but in the UK there are fixed-rate mortgages and variable-rate mortgages. Fixed rate ones are where the interest rate is locked in at the time the mortgage is taken out so any…
I would assume it would be because the poster would find themselves in negative equity (depending on how much was left to repay on the mortgage) with all the potential pitfalls that come with it, such as if you want to…
! is commonly used as the unary not operator, so "a != b" makes sense as a shortcut for "!(a == b)". a not equals b.
FYI: this is the latest draft of the proposal and it has not been voted into C++26 yet, but it is getting close.
Rumour has it (not sure if this was ever confirmed) that one of the big reasons the second Xbox was called the Xbox 360 was to avoid unfavourable number comparisons with Sony. The Xbox launched vs the PS2, which meant…
A lot of programmers refer to the compiler explorer as Godbolt due to the domain name, such as saying "Godbolt link", "try it on Godbolt", etc. They do not realise that the domain name is Godbolt.org not because…
For those who missed it: each item on the iceberg is actually a link that explains the topic in more detail.
Calling it a hint is very much over-simplifying things as there are also restrictions on what a constexpr function is and is not allowed to do, although those restrictions become fewer and fewer as time goes on as…
Regarding new/delete elision: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p09... You can also specify custom new/delete operations for your co-routine for control. I am not sure if you are allowed to delete…
It is undefined behaviour to modify objects declared as const (except if those objects have mutable members, in which case the mutable members can be modified). const int a = 1; If you try to const_cast away the const…
A post about an obscure C++ feature on Hacker News? Comments are going to be a dumpster-fire as usual. https://en.cppreference.com/w/cpp/utility/launder "template <class T> [[nodiscard]] constexpr T* launder (T* p)…
Misleading title? This is a Windows API bug with the slim reader/writer (SRW) locks. It's just that the bug was discovered via std::shared_mutex as that is implemented using SRW locks. SRW locks:…
A new version of C++ comes out every 3 years, and every 3 years you will get loads of blog posts giving overviews of the changes as well as YouTube videos of conference talks on different things, which I watch in…
Yes. The main feature this is built upon is C++20's new string formatting features (very heavily inspired by the third party libfmt). C++23 just adds convinience functions to format and print at the same time. Type…
It's being actively worked on for C++2x. This video is a fairly recent update on how it's progressing: https://www.youtube.com/watch?v=AoLl_ZZqyOk Note for those who are not used to C++Now talks: they are intented to be…
https://en.wikipedia.org/wiki/GLib
I just made a new empty C++ project in MSVC 2022 and by default it generates compile options for both 32-bit and 64-bit, with 64-bit selected by default. The preprocessor mode can be manually changed trivially. Project…
The issue is that code outside of some_func does not know that f has been destroyed and a new object created in the same memory location, thus wouldn't know that the const member foo::x now has a new value. As for why…
It is UB as the original object has non-static data members that are const-qualified.
foo::x is declared const inside the struct in the example given. Because of this, regardles of how you access foo::x, it will always be const.
No idea how it works in other countries but in the UK there are fixed-rate mortgages and variable-rate mortgages. Fixed rate ones are where the interest rate is locked in at the time the mortgage is taken out so any…
I would assume it would be because the poster would find themselves in negative equity (depending on how much was left to repay on the mortgage) with all the potential pitfalls that come with it, such as if you want to…
! is commonly used as the unary not operator, so "a != b" makes sense as a shortcut for "!(a == b)". a not equals b.
FYI: this is the latest draft of the proposal and it has not been voted into C++26 yet, but it is getting close.
Rumour has it (not sure if this was ever confirmed) that one of the big reasons the second Xbox was called the Xbox 360 was to avoid unfavourable number comparisons with Sony. The Xbox launched vs the PS2, which meant…
A lot of programmers refer to the compiler explorer as Godbolt due to the domain name, such as saying "Godbolt link", "try it on Godbolt", etc. They do not realise that the domain name is Godbolt.org not because…
For those who missed it: each item on the iceberg is actually a link that explains the topic in more detail.
Calling it a hint is very much over-simplifying things as there are also restrictions on what a constexpr function is and is not allowed to do, although those restrictions become fewer and fewer as time goes on as…
Regarding new/delete elision: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p09... You can also specify custom new/delete operations for your co-routine for control. I am not sure if you are allowed to delete…
It is undefined behaviour to modify objects declared as const (except if those objects have mutable members, in which case the mutable members can be modified). const int a = 1; If you try to const_cast away the const…
A post about an obscure C++ feature on Hacker News? Comments are going to be a dumpster-fire as usual. https://en.cppreference.com/w/cpp/utility/launder "template <class T> [[nodiscard]] constexpr T* launder (T* p)…
Misleading title? This is a Windows API bug with the slim reader/writer (SRW) locks. It's just that the bug was discovered via std::shared_mutex as that is implemented using SRW locks. SRW locks:…
A new version of C++ comes out every 3 years, and every 3 years you will get loads of blog posts giving overviews of the changes as well as YouTube videos of conference talks on different things, which I watch in…
Yes. The main feature this is built upon is C++20's new string formatting features (very heavily inspired by the third party libfmt). C++23 just adds convinience functions to format and print at the same time. Type…
It's being actively worked on for C++2x. This video is a fairly recent update on how it's progressing: https://www.youtube.com/watch?v=AoLl_ZZqyOk Note for those who are not used to C++Now talks: they are intented to be…
https://en.wikipedia.org/wiki/GLib
I just made a new empty C++ project in MSVC 2022 and by default it generates compile options for both 32-bit and 64-bit, with 64-bit selected by default. The preprocessor mode can be manually changed trivially. Project…
The issue is that code outside of some_func does not know that f has been destroyed and a new object created in the same memory location, thus wouldn't know that the const member foo::x now has a new value. As for why…
It is UB as the original object has non-static data members that are const-qualified.
foo::x is declared const inside the struct in the example given. Because of this, regardles of how you access foo::x, it will always be const.