Hacker News new | past | comments | ask | show | jobs | submit login
C++ Value Categories (ncona.com)
17 points by adrianancona 5 days ago | hide | past | web | favorite | 9 comments





With all due respect but it looks like a trimmed down copy-paste from cppreference. I dont think they are original themselves, but they don't pretend to be imho. Maybe it's just the same source.

Information-wise it's nothing more and slightly less. So I'd suggest checking the other source.


> Lvalue stands for locator value.

Wait, I thought it was for a value that could appear on the "left" hand side of an expression…


The C99 standard draft (n1256) says about “lvalue”, on p. 46:

It is perhaps better considered as representing an object ‘‘locator value’’.

http://www.open-std.org/jtc1/sc22/WG14/www/docs/n1256.pdf


It is.

That would make the term “modifiable lvalue” pointless. You can look it up in the standard.

Why? It is definitely from "left" (and rvalue is from "right"). It's pretty obvious.

If you need proof you can look it up in the standard:

https://stackoverflow.com/a/15765936/265521


Worst writeup on the subject I've seen so far.

I agree: I do not master C++ value categories, but I am pretty sure there are a few errors. And you don't get to understand much anyway. Does anybody know some better writeup on the subject? It is probably the biggest core C++ topic that I still have to properly digest.

> An lvalue is something that occupies a memory location.

Not necessarily. It might also inhabit a register.

> When C++ introduced the const keyword...

As of Stroustrup's first publication of “The C++ Programming Language”, C++ has always had the `const` qualifier.

There may be more errors, but this should be enough to discard this writeup and seek enlightenment from a qualified source.




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: