Recent submissions

Comment · 11 years ago
Comment · 11 years ago
Comment · 11 years ago
I will make sure this is made clear in the sample descriptions.

Experimental means that it's part of Technical Specification - basically the proving ground before being accepted into the C++ standard. It is truly cutting edge stuff, so should only be used where there would not be drastic consequences if it were to suddenly change or disappear.

Comment · 11 years ago
The samples are all very short and generic, so I'm not sure how legal significance a copyright license will have. However, I do plan to add a license to the repository if only to make it clearer.

Is CC0 appropriate for code? I was thinking of going with MIT, but that would require retaining the license in any derivative works. Anybody have thoughts on this matter?

Comment · 11 years ago
Very true, and the site will be a little less useful for those people. I am also planning to add a note to every sample stating which standard it depends on, which should make this problem a bit better.
Comment · 11 years ago
I need to add a license to the samples repository (license suggestions welcome). The samples are all so short and generic that I'm not sure what legal significance it would actually have, but it's worth doing anyway if only to promote sharing and contributions.
Comment · 11 years ago
My biggest concern with Googling for these things is that the Stack Overflow answers range from bad practices, to good C++03 practices, to good C++11/14 practices. It's difficult to know exactly what the state-of-the-art is.
Comment · 11 years ago
Comment · 12 years ago
You can have values that don't belong to objects. I consider there to be three types of value computations:

- The value computations of operators, like 5 + 6. These don't use the values of objects. They just use the values of their operands. The operands may be subexpressions that denote objects (like 5 + x), but it is the value computation of those subexpressions that uses the object's value, not the value computation of the operator.

- The value computations of expressions denoting objects where the expression is being used as an lvalue. These also don't use the values of objects - they only care about the object's storage location. I give an example in the article, which is the left operand of =.

- The value computation of expressions denoting objects where the expression is being used as an rvalue. This means lvalue-to-rvalue conversion is performed, which is conceptually "reading an object's value out of memory". This, therefore, uses the value of the object.

Comment · 12 years ago
Author here - Apologies, I'll work on making that better. It could perhaps do with an intermediate step where the expression is broken down into a subexpression tree.
Comment · 12 years ago
Author here - absolutely! This is only for those with an interest in the details of C++ evaluation. Considering the number of times I see these expressions in a purely theoretical context, I assume many people are at least intrigued.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton