Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope

quiggy posted:

the easy solution to const_cast abusers in c++ is murder

that's your solution to everything

Adbot
ADBOT LOVES YOU

Xarn
Jun 26, 2015
Sometimes it really is the best solution.

oh no blimp issue
Feb 23, 2011

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

VikingofRock
Aug 24, 2008




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?

Xarn
Jun 26, 2015

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.

hobbesmaster
Jan 28, 2008

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

oh no blimp issue
Feb 23, 2011

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

oh no blimp issue
Feb 23, 2011

then you const_cast them both away!

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?
and we couldn't possibly have a different keyword mean "read-only," we have to reuse the one that already means "won't change"

Soricidus
Oct 21, 2010
freedom-hating statist shill

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.

Chalks
Sep 30, 2009

Soricidus posted:

const has never meant "won't change".

Besides the fact that the word "constant" literally means "won't change"

Brain Candy
May 18, 2006

object doesn't mean a struct with a vtable, yet here we are

Soricidus
Oct 21, 2010
freedom-hating statist shill

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

hobbesmaster
Jan 28, 2008

Chalks posted:

Besides the fact that the word "constant" literally means "won't change"

its C, nothing is as it appears to be

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer

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?

next let's discuss how dumb it is that the char type doesn't have anything to do with burning, cleaning, or fish

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.

hobbesmaster
Jan 28, 2008

if you are a c++ dev applying to a c++ position then knowing that the language is full of land mines is a requirement

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer

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?

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer
.

The MUMPSorceress fucked around with this message at 07:04 on Jan 13, 2017

Captain Foo
May 11, 2004

we vibin'
we slidin'
we breathin'
we dyin'


I like you are article, but don't like the fact that u have a new av

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer

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.

ulmont
Sep 15, 2010

IF I EVER MISS VOTING IN AN ELECTION (EVEN AMERICAN IDOL) ,OR HAVE UNPAID PARKING TICKETS, PLEASE TAKE AWAY MY FRANCHISE

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."

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer

ulmont posted:

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."

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.

quiggy
Aug 7, 2010

[in Russian] Oof.


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.

and no matter how many times i cast to char * to do pointer arithmetic it never feels right to me.

well yeah because you should be casting to uint8_t* :rolleye:

Asymmetrikon
Oct 30, 2009

I believe you're a big dork!

this is really good; just checking, do you mind if people share this?

ulmont
Sep 15, 2010

IF I EVER MISS VOTING IN AN ELECTION (EVEN AMERICAN IDOL) ,OR HAVE UNPAID PARKING TICKETS, PLEASE TAKE AWAY MY FRANCHISE

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.

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer

Asymmetrikon posted:

this is really good; just checking, do you mind if people share this?

feel free

jony neuemonic
Nov 13, 2009

Asymmetrikon posted:

this is really good

:same:

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer

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.

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer
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

fritz
Jul 26, 2003

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:


Sex: Sex is typically assigned at birth (or before during ultrasound) Sex refers to a person’s biological status and is typically categorized as male, female, or intersex (i.e., Sex refers to a person’s biological status and is typically categorized as male, female or intersex based on the appearance of external genitalia.

fritz
Jul 26, 2003

also you never define "tgnc"

fritz
Jul 26, 2003

i assume it doens't mean 'thank god (for) noam chomsky" or "the generation next crew"

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer

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

ulmont
Sep 15, 2010

IF I EVER MISS VOTING IN AN ELECTION (EVEN AMERICAN IDOL) ,OR HAVE UNPAID PARKING TICKETS, PLEASE TAKE AWAY MY FRANCHISE

LeftistMuslimObama posted:

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.

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.

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer

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.

I only read Russia Today though.

lol, are you in a vladimir putin youth admiration society?

ulmont
Sep 15, 2010

IF I EVER MISS VOTING IN AN ELECTION (EVEN AMERICAN IDOL) ,OR HAVE UNPAID PARKING TICKETS, PLEASE TAKE AWAY MY FRANCHISE

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

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer

ulmont posted:

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

fyi russia today is a kremlin mouthpiece

ulmont
Sep 15, 2010

IF I EVER MISS VOTING IN AN ELECTION (EVEN AMERICAN IDOL) ,OR HAVE UNPAID PARKING TICKETS, PLEASE TAKE AWAY MY FRANCHISE

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

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer

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.

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.

lol. how much outreach do they do toward nazis hiding in argentina?

Adbot
ADBOT LOVES YOU

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed

quiggy posted:

well yeah because you should be casting to uint8_t* :rolleye:

but then your code won't compile on platforms where CHAR_BIT isn't 8

  • Locked thread