Live data from Hacker News

C++ value category cheat-sheet [pdf]

github.com

1–10 of 41 posts

Re: C++ value category cheat-sheet [pdf]

#3
It is great, but regarding the format I would suggest some options to PDF:

a) markdown with embedded graphviz.

ex: https://github.com/TLmaK0/gravizo

b) a jupyter notebook (which also uses markdown blocks). jupyter can embed C++, so you can have interactive blocks that you can evaluate and play with.

ex: https://github.com/minrk/clingkernel/blob/master/cling.ipynb

Both seem more performant than in-browser PDF rendering.

Re: C++ value category cheat-sheet [pdf]

#4

It is great, but regarding the format I would suggest some options to PDF: a) markdown with embedded graphviz. ex: https://github.com/TLmaK0/gravizo b) a jupyter notebook (which also uses markdown blocks). jupyter can embed C++, so you can have interactive blocks that you can evaluate and play with. ex: https://github.com/minrk/clingkernel/blob/master/cling.ipynb Both seem more performant than in-browser PDF renderin…

I looked for a number of options and I didn't find anything which could provide me with automatic syntax highlighting, non-html layouts, and quick iteration. That doesn't mean that such a thing doesn't exist!

Thanks for the suggestions.

Re: C++ value category cheat-sheet [pdf]

#5
A comment on the document's design: The low contrast of light gray text on yellow background makes it difficult to read. Black text on white, or dark gray text on white is perfectly acceptable.

Another drawback of colored backgrounds is that readers wanting to print out the pdf will consume ink/toner to render the non-white background.

Re: C++ value category cheat-sheet [pdf]

#6
post #4

It is great, but regarding the format I would suggest some options to PDF: a) markdown with embedded graphviz. ex: https://github.com/TLmaK0/gravizo b) a jupyter notebook (which also uses markdown blocks). jupyter can embed C++, so you can have interactive blocks that you can evaluate and play with. ex: https://github.com/minrk/clingkernel/blob/master/cling.ipynb Both seem more performant than in-browser PDF renderin…

I looked for a number of options and I didn't find anything which could provide me with automatic syntax highlighting, non-html layouts, and quick iteration. That doesn't mean that such a thing doesn't exist! Thanks for the suggestions.

Jupyter notebooks are probably what you are looking for. I highly recommend them. Embedded REPL makes iteration very fast and results can be shared directly through a URL, exported to various formats or shared in websites that support it such as github.

Re: C++ value category cheat-sheet [pdf]

#8
post #2

Reddit discussion: https://www.reddit.com/r/cpp/comments/5zzurr/c_value_categor...

I'd love it if someone could shed some light on my question here:

https://www.reddit.com/r/cpp/comments/5zzurr/c_value_categor...

    int const &f(int const &a) { return a; }
    int r = f(3);
Is the value of r implementation-defined according to the standard?

Re: C++ value category cheat-sheet [pdf]

#10

Question: it is ok to initialize a string_view from a string literal, right? e.g. std::string_view sv{ "lvalue" }; or auto sv{ "lvalue"sv };

Yeah. String literals are lvalues and they live for the lifetime of the program. Both of those snippets would be fine.
Post reply on HN