|
quiggy posted:the easy solution to const_cast abusers in c++ is murder that's your solution to everything
|
# ? Dec 11, 2016 20:36 |
|
|
# ? May 26, 2024 09:34 |
|
Sometimes it really is the best solution.
|
# ? Dec 11, 2016 20:46 |
|
my favourite thing about C/C++ is that a variable can be both const and volatile, it makes sense when you think about it but that was an odd one to see for the first time
|
# ? Dec 11, 2016 21:42 |
oh no blimp issue posted:my favourite thing about C/C++ is that a variable can be both const and volatile, it makes sense when you think about it but that was an odd one to see for the first time Is that used for like embedded systems that have read-only registers, and reading them has some side effect or the value might change so reads can't be optimized out?
|
|
# ? Dec 11, 2016 21:58 |
|
VikingofRock posted:Is that used for like embedded systems that have read-only registers, and reading them has some side effect or the value might change so reads can't be optimized out? Not necessarily side effects, but their value can change outside of the C machine model.
|
# ? Dec 11, 2016 22:01 |
|
VikingofRock posted:Is that used for like embedded systems that have read-only registers, and reading them has some side effect or the value might change so reads can't be optimized out? or if you change it in an ISR or something
|
# ? Dec 11, 2016 22:07 |
|
say you have a hardware mapped memory location, you don't want to write to it but the value might change without your input, then you use both keywords
|
# ? Dec 11, 2016 22:47 |
|
then you const_cast them both away!
|
# ? Dec 11, 2016 22:48 |
|
and we couldn't possibly have a different keyword mean "read-only," we have to reuse the one that already means "won't change"
|
# ? Dec 11, 2016 22:50 |
|
eschaton posted:and we couldn't possibly have a different keyword mean "read-only," we have to reuse the one that already means "won't change" const has never meant "won't change". at best it's always meant "this particular bit of code, accessing the object through this variable, will probably not directly make it change" except you know it's going to cast away the constness/use mutable member variables/have a non-const alias. one of those things is going to happen. const is a lie. it has never meant what you want it to mean.
|
# ? Dec 11, 2016 23:03 |
|
Soricidus posted:const has never meant "won't change". Besides the fact that the word "constant" literally means "won't change"
|
# ? Dec 11, 2016 23:10 |
|
object doesn't mean a struct with a vtable, yet here we are
|
# ? Dec 11, 2016 23:13 |
|
Chalks posted:Besides the fact that the word "constant" literally means "won't change" maybe they'd have used the word constant if they had meant constant, instead of using a vaguely similar word to indicate a vaguely similar concept? next let's discuss how dumb it is that the char type doesn't have anything to do with burning, cleaning, or fish
|
# ? Dec 11, 2016 23:29 |
|
Chalks posted:Besides the fact that the word "constant" literally means "won't change" its C, nothing is as it appears to be
|
# ? Dec 12, 2016 01:46 |
|
Soricidus posted:maybe they'd have used the word constant if they had meant constant, instead of using a vaguely similar word to indicate a vaguely similar concept? this is why i kinda eyeroll when people say "its totally normal for an interviewer to reject a candidate who can't explain <some concept specific to c or c++> off the top of their head." who outside of very particular domains needs to remember that poo poo? it's learnable if you need it but it shouldn't be a black mark that i have no idea what const means in the context of c programming. and no matter how many times i cast to char * to do pointer arithmetic it never feels right to me.
|
# ? Dec 12, 2016 01:56 |
|
if you are a c++ dev applying to a c++ position then knowing that the language is full of land mines is a requirement
|
# ? Dec 12, 2016 01:59 |
|
hobbesmaster posted:if you are a c++ dev applying to a c++ position then knowing that the language is full of land mines is a requirement posters in this very forum think its normal for questions like that to be in standard interviews at McAppHouse. and also, how do ppl expect someone to learn the language if you have to know everything about it before you can work on anything where it's relevant?
|
# ? Dec 12, 2016 02:01 |
|
.
The MUMPSorceress fucked around with this message at 07:04 on Jan 13, 2017 |
# ? Dec 12, 2016 02:16 |
|
LeftistMuslimObama posted:also i published that article, dont doxx me I like you are article, but don't like the fact that u have a new av
|
# ? Dec 12, 2016 02:25 |
|
Captain Foo posted:I like you are article, but don't like the fact that u have a new av i pissed someone off in d&d and they redtitled me so i had to buy a new one.
|
# ? Dec 12, 2016 02:38 |
|
LeftistMuslimObama posted:https://medium.com/@aleksandra_s/sex-gender-identity-and-why-theyre-probably-not-the-data-you-want-in-your-software-552da53d6f20#.kg6t0tmy8 There's some weirdness in your second and third sentences of the paragraph starting with "Sex." From a completely different perspective I considered at one point writing a paper about how, under existing constitutional doctrine relating to differing treatment of people by gender, preemptive imprisonment of assigned males would likely be justified based on the differential crime rates. EDIT1: Testosterone is a helluva drug. EDIT2: I see "Goku Haram" and hear "a yellower shade of pale."
|
# ? Dec 12, 2016 02:40 |
|
ulmont posted:There's some weirdness in your second and third sentences of the paragraph starting with "Sex." good catch, formatting error from the cite source. i fixed it. and lol at that thesis, the earnestness with which people would react to that would prove the death of irony. you can tell how world-aware someone is by whether they get the goku haram joke or not.
|
# ? Dec 12, 2016 02:45 |
|
LeftistMuslimObama posted:this is why i kinda eyeroll when people say "its totally normal for an interviewer to reject a candidate who can't explain <some concept specific to c or c++> off the top of their head." who outside of very particular domains needs to remember that poo poo? it's learnable if you need it but it shouldn't be a black mark that i have no idea what const means in the context of c programming. well yeah because you should be casting to uint8_t*
|
# ? Dec 12, 2016 03:20 |
|
LeftistMuslimObama posted:https://medium.com/@aleksandra_s/sex-gender-identity-and-why-theyre-probably-not-the-data-you-want-in-your-software-552da53d6f20#.kg6t0tmy8 this is really good; just checking, do you mind if people share this?
|
# ? Dec 12, 2016 03:26 |
|
LeftistMuslimObama posted:you can tell how world-aware someone is by whether they get the goku haram joke or not. I feel like I'm missing a joke about concubines and a joke about sharia in the process yes.
|
# ? Dec 12, 2016 03:47 |
|
Asymmetrikon posted:this is really good; just checking, do you mind if people share this? feel free
|
# ? Dec 12, 2016 04:03 |
|
Asymmetrikon posted:this is really good
|
# ? Dec 12, 2016 04:07 |
|
ulmont posted:I feel like I'm missing a joke about concubines and a joke about sharia in the process yes. https://en.wikipedia.org/wiki/Boko_Haram purely an insensitive pun, nothing deeper. but if u dont pay attention to world events its easy to have no idea about boko haram.
|
# ? Dec 12, 2016 04:12 |
|
and thank u for the compliments everyone. sign my petition: https://petitions.whitehouse.gov/petition/change-title-president-united-states-america-grand-nagus-upon-mr-trumps-inauguration
|
# ? Dec 12, 2016 04:21 |
|
LeftistMuslimObama posted:good catch, formatting error from the cite source. i fixed it. and lol at that thesis, the earnestness with which people would react to that would prove the death of irony. quote:
|
# ? Dec 12, 2016 04:25 |
|
also you never define "tgnc"
|
# ? Dec 12, 2016 04:25 |
|
i assume it doens't mean 'thank god (for) noam chomsky" or "the generation next crew"
|
# ? Dec 12, 2016 04:26 |
|
god dammit. that loving cite is all the formatting errors edit: fixed and added a second cite for tgnc. thanks for catching. The MUMPSorceress fucked around with this message at 04:32 on Dec 12, 2016 |
# ? Dec 12, 2016 04:28 |
|
LeftistMuslimObama posted:https://en.wikipedia.org/wiki/Boko_Haram Now that you mention it, I remember the bring back our girls movement, but haven't heard anything about these guys in a while. I only read Russia Today though.
|
# ? Dec 12, 2016 04:32 |
|
ulmont posted:Now that you mention it, I remember the bring back our girls movement, but haven't heard anything about these guys in a while. lol, are you in a vladimir putin youth admiration society?
|
# ? Dec 12, 2016 04:33 |
|
LeftistMuslimObama posted:lol, are you in a vladimir putin youth admiration society? Not yet, but there's still time! It was one of the first "news" twitter feeds in Spanish I found when I started getting back into learning the language: https://twitter.com/ActualidadRT
|
# ? Dec 12, 2016 04:39 |
|
ulmont posted:Not yet, but there's still time! fyi russia today is a kremlin mouthpiece
|
# ? Dec 12, 2016 04:40 |
|
LeftistMuslimObama posted:fyi russia today is a kremlin mouthpiece Hence the "news" description (I think they just got officially downgraded to "Russian propaganda outlet" in Europe from news organization). It's pretty funny to see the Russian view of the world Russia wants to send to Latin America. EDIT: if there's an anti-US take they can be amazingly quick though; they have school shootings and chemical plant releases up before anyone else. ulmont fucked around with this message at 04:44 on Dec 12, 2016 |
# ? Dec 12, 2016 04:42 |
|
ulmont posted:Hence the "news" description (I think they just got officially downgraded to "Russian propaganda outlet" in Europe from news organization). It's pretty funny to see the Russian view of the world Russia wants to send to Latin America. lol. how much outreach do they do toward nazis hiding in argentina?
|
# ? Dec 12, 2016 04:45 |
|
|
# ? May 26, 2024 09:34 |
|
quiggy posted:well yeah because you should be casting to uint8_t* but then your code won't compile on platforms where CHAR_BIT isn't 8
|
# ? Dec 12, 2016 07:25 |