[PATCH] Update the coding standards to provide some guidance for a few constructs in C++11

James Dennett jdennett at google.com
Fri Feb 28 19:57:55 PST 2014


  This looks helpful, I have just a couple of questions about how the sun might strike the southern aspect of the bikeshed in summer.


================
Comment at: docs/CodingStandards.rst:667
@@ +666,3 @@
+(without any type for temporaries) when doing aggregate initialization or
+something notionally equivalent. Examples:
+
----------------
Does use of a constructor taking a std::initializer_list<T> parameter count as "notionally equivalent" to aggregate initialization, or is it under the general "Do not use these...if you care that you're calling some *particular* constructor" case?  I could make an argument for either.

Maybe the easiest way to document that is with an example indicating whether
std::vector<int> Very SmallPrimes = { 2, 3, 5 };
is permitted or not.

(While I do have a preferred answer, I'm not here to lobby for it, just to ask what the intent is.  Lobbying can happen later.  Much later.)

================
Comment at: docs/CodingStandards.rst:513
@@ +512,3 @@
+worse, we also have many more uses of braces in an expression context that are
+*not* performing initialization.
+
----------------
Meaning lambdas, or...?  (I"m not sure this warrants any editing, but as a reader my first reaction to this was "I wonder what that's talking about".)


http://llvm-reviews.chandlerc.com/D2905



More information about the llvm-commits mailing list