1,740 karma · joined January 13, 2014
However, given how low-level a language C++ is, we can actually break this assumption by setting i to y-x. Since &x[i] is the same as x+i, this means we are actually writing 23 to &y[0].
But that is undefined, you can't do x + (y - x) ie a pointer arithmetic that ends outside of bounds of an array. Since it is undefined, shouldn't C++ assume that changing x[..] can't change y[0]edit: welp, if I read a few more lines into article I would see that it also tells it is undefined
Sure different compilers might allow inlining assembly or some other ways to access x on previous stack perhaps but then it is not really "C"
“We must minimize the need to change existing code. For adoption in existing code, decades of experience has consistently shown that most customers with large code bases cannot and will not change even 1% of their lines of code in order to satisfy strictness rules, not even for safety reasons unless regulatory requirements compel them to do so.” – Herb Sutter
with large code bases cannot and will not change even 1% of their lines of code in order to satisfy strictness rules
Do people really say this? Voice this in committee? I have been in a few companies, and one fairly large one, and all are happy to and looking forward to upgrade newer standards and already spend a lot of time updating their build systems. Changing 1% of code on top of that is probably not really that much compared Didn't Magnus Carlsen say he only needs a single move from a chess computer in the right moment to be virtually guaranteed win
If we are thinking of the same quote, iirc he said all he needs is a prompt from computer "there is a winning move here"Alternatively you can reset your TV to factory settings and then disable auto updates for TV and google play. You will probably want to check google play from time to time and manually update the apps you are using though (just don't update things like "home screen" or whatever that will put ads backs). I was doing that but I was not comfortable leaving my TV unupdated
A while ago Turkey switched to a different timezone and stopped doing DST for reasons and now everyone was waking up one hour early in winters. Considering how bad traffic is in larger cities that meant a lot of people will be waking up and going to work or school while it is still dark.
02:21
or instead of digits from 0 to F, the letters would go up V. 85 would be 0x2k I think (2 * 32 + 21)But interestingly no distinct words for grandfathers, both grandfathers are called "dede" (so no "babababa" or "annebaba")
In virtually all browsers, pressing Escape while a webpage is loading stops the loading process.
Whoa, never knew about this or noticed itOf course this also fails if the oil formed a disc of X layers of molecules
I think the campaign does opposite of what it says. Using 5 digits limits your dates to dates to a maximum of year 99999. While not giving a fuck, using the digits needed to represent a year, works for all years. No one is clamping their years to 4 digits when they say '2024', they are just using the necessary digits needed for that year
const MyClass& getMyClass(){....}
auto obj = getMyClass();
this makes a copy right?
And it was very confident about it not making a copy. It thinks auto will deduce the type as a const ref and not make a copy. Which is wrong, you need auto& or const auto& for that. I asked it if it is sure and it was even more confident.Here is the godbolt output https://godbolt.org/z/Mz8x74vxe . You can see the "copy" being printed. And you can also see you can call non-const methods on copied object, which implies it is a non-const type
I asked the very same question to phind and it gave the same answer https://www.phind.com/search?cache=k3l4g010kuichh9rp4dl9ikb
How come two different AIs, one was supposed to be specialized on coding, fails in such a confident way?