View on GitHub

jmmut

Personal blog

Posts with tag [today-I-learned]:

2020-11-13 Til Mutable [ programming today-I-learned ]

mutable, const and caches

Have you ever done some kind of cache in C++? Like, computing a field lazily (so that it’s not computed until it’s needed), and keeping it to avoid computing it again.

And did you try to put that lazy field inside a class that is used as const in some place?

Read more