From 13c4659220bc78a0a3529f4d9e57546e898088e3 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 20 Jan 2002 19:01:26 +0000 Subject: [PATCH] Add a note about endl semantics git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1502 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/CodingStandards.html | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/docs/CodingStandards.html b/docs/CodingStandards.html index 62288cc9e86..8566e670f20 100644 --- a/docs/CodingStandards.html +++ b/docs/CodingStandards.html @@ -37,6 +37,7 @@
  1. Assert Liberally
  2. Prefer Preincrement +
  3. Avoid endl
  4. Exploit C++ to its Fullest
  • Writing Iterators @@ -292,6 +293,19 @@ Hard fast rule: Preincrement (++X) may be no slower than postincrement (X++) and The semantics of postincrement include making a copy of the value being incremented, returning it, and then preincrementing the "work value". For primitive types, this isn't a big deal... but for iterators, it can be a huge issue (for example, some iterators contains stack and set objects in them... copying an iterator could invoke the copy ctor's of these as well). In general, get in the habit of always using preincrement, and you won't have a problem.

    + +


    Avoid endl


    Exploit C++ to its Fullest