@Lady younger brother does, in fact, know what a graph is
c++
It's annoying how arbitrary the rules for value categories are.
then casting something as an lvalue reference should be the same, right? Wrong. It is an lvalue because the standard says it is. Ok.
temporary values, even if they have an address, are still rvalues even if the address is not made available to the programmer (this most often occurs when you return an object from a function call). okay, fine.
but string literals are lvalues??? & is defined on a string literal? why? why only for string literals and not all objects??????
accessing an element of an array from an expression for an array that is, itself an rvalue (ie, get_array()[0]
) is an xvalue, not a prvalue. I guess, by definition, arrays elements are inherently addressable data available to me so sure, why not.
but get_object().property
is also an xvalue. why. why is it an xvalue. even though objects have addresses they are not exposed to the user if they are temporary so why is the property access now considered addressable??????
I truly don't think it's possible to derive in the general case whether something is a prvalue, xvalue, or lvalue from first principles. For a lot of cases you just have to see what the standard says they are and try to make sense of it.
Maybe if I understood more about compilers there could be good reasons for these value categories but then again, if the language can only be properly understood by understanding implementation details of its compiler then it is not an effective programming language imo.
@wallhackio are my other posts not boostable?? >8(
at my work near the entrance i always use there is a poster frame that includes a cubby for pamphlets. However, there are no pamphlets, and someone stuck a little container of lip gloss in there.
it has been there for months. no one removes the lip gloss. it remains resolute, indomitable. it is the Rock of my work building.
I always know that, no matter how chaotic life gets, I can always count on lip gloss to still be in its little pamphlet cubby.
@wallhackio all data is json there is only one type and it’s object
Movie/animation/anime fan. Videogame enjoyer. Food liker. Physics and mathematics hobbyist. Software Engineer. Professional wonk. Professional shadowheart fricker. Prophet of The Truth. I would not be surprised if I had autism + adhd. I like animals that wear cowboy hats.
"i regret ever allowing him here" ~aescling
he/him