Anders Knatten

blog.knatten.org · Personal blog · on HN since 2012

Anders Knatten, a C++ developer, writes about the language's value categories, type system and quirks.

What HN saysHN commenters recommend his explanation of lvalues, rvalues, glvalues, prvalues and xvalues as clear and helpful for understanding move semantics.
15HN people shared it
2linked it in comments
23stories submitted
412story points
12 months agolast shared
2012people per year2026

Most-shared posts

  1. 1
    Lvalues, rvalues, glvalues, prvalues, xvalues, help (2018)
    5 people · 249 points · first shared 2018 · 92 comments on HN
  2. 2
    The type of char + char
    4 people · 62 points · first shared 2019 · 45 comments on HN
  3. 3
    A Taxonomy of C++ Types
    2 people · 4 points · first shared 2025 · discussion on HN
  4. 4
    Very Strong C++ Track at the NDC Conference
    2 people · 2 points · first shared 2014 · discussion on HN
  5. 5
    A prvalue is not a temporary
    1 people · 79 points · first shared 2025 · 63 comments on HN
  6. 6
    Another Reason to Avoid #includes in Headers
    1 people · 2 points · first shared 2012 · 1 comments on HN
  7. 7
  8. 8
    C++ on a Friday: +“”
    1 people · 2 points · first shared 2018 · discussion on HN
  9. 9
    No-one knows the type of char + char
    1 people · 2 points · first shared 2019 · discussion on HN
  10. 10
    Microsoft C++ Versions Explained
    1 people · 2 points · first shared 2022 · discussion on HN
  11. 11
    I Wrote a C++ Book
    1 people · 2 points · first shared 2024 · discussion on HN
  12. 12
    References don’t have top-level CV-qualifiers
    1 people · 1 points · first shared 2023 · discussion on HN
  13. 13
  14. 14
    Help save CppQuiz.org: We’re porting to C++17
    1 people · 1 points · first shared 2018 · discussion on HN
  15. 15
    How to avoid includes in headers
    1 people · 1 points · first shared 2012 · discussion on HN

What HN people wrote when they linked it

spacechild1 · 2025-11-06
This is actually a very nice explanation! I also enjoyed the linked article about the 5 value types: https://blog.knatten.org/2018/03/09/lvalues-rvalues-glvalues-prvalues-… For some reason I never bothered to look up these terms as they sounded so obscure. Turns out the taxonomy is pretty clear and it's just a refinement of the existing two value types (lvalues and rvalues). EDIT: I do think the naming is rather confusing and inconsistent, though.
cjensen · 2025-11-06
He has a good article on that at [1] But here's the gist: sometimes you have an object you want to copy, but then abandon the original. Maybe it's to return an object from a function. Maybe it's to insert the object into a larger structure. In these cases, copying can be expensive and it would be nice if you could just "raid" the original object to steal bits of it and construct the "copy" out of the raided bits. C++11 enabled this with rvalue references, std::move, and rvalue reference constructors. This added a lot of "what the hell is this" to C++ code and a lot of new mental-model stuff to track for programmers. I understand why it was all added, but I have deep misgivings about the added complexity. [1] https://blog.knatten.org/2018/03/09/lvalues-rvalues-glvalues-prvalues-…

Keyboard shortcuts

/Search
j kNext / previous blog
EnterOpen selected blog
vVisit the blog site
fFollow / unfollow
lSwitch grid / list view
dSwitch dark mode
g hHome
g pTop posts
g tTopics
g fFollowing
g lLiked
g yHistory
g qFAQ
EscBack / close