| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <!-- | 2 <!-- |
| 3 Copyright 2014 The Chromium Authors. All rights reserved. | 3 Copyright 2014 The Chromium Authors. All rights reserved. |
| 4 Use of this source code is governed by a BSD-style license that can be | 4 Use of this source code is governed by a BSD-style license that can be |
| 5 found in the LICENSE file. | 5 found in the LICENSE file. |
| 6 --> | 6 --> |
| 7 <html> | 7 <html> |
| 8 <head> | 8 <head> |
| 9 <meta charset="utf-8"> | 9 <meta charset="utf-8"> |
| 10 <title>C++11 use in Chromium</title> | 10 <title>C++11 use in Chromium</title> |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 <td>Suppresses the implementation of a function, especially a synthetic function
such as a copy constructor</td> | 177 <td>Suppresses the implementation of a function, especially a synthetic function
such as a copy constructor</td> |
| 178 <td>TODO: documentation link</td> | 178 <td>TODO: documentation link</td> |
| 179 <td><a href="https://groups.google.com/a/chromium.org/forum/#!topic/chromium-dev
/i1o7-RNRnMs">Discussion thread</a></td> | 179 <td><a href="https://groups.google.com/a/chromium.org/forum/#!topic/chromium-dev
/i1o7-RNRnMs">Discussion thread</a></td> |
| 180 </tr> | 180 </tr> |
| 181 | 181 |
| 182 <tr> | 182 <tr> |
| 183 <td>Lambda Expressions</td> | 183 <td>Lambda Expressions</td> |
| 184 <td><code>[<i>captures</i>](<i>params</i>) -> <i>ret</i> { <i>body</i> }</cod
e></td> | 184 <td><code>[<i>captures</i>](<i>params</i>) -> <i>ret</i> { <i>body</i> }</cod
e></td> |
| 185 <td>Anonymous functions</td> | 185 <td>Anonymous functions</td> |
| 186 <td><a href="http://en.cppreference.com/w/cpp/language/lambda">Lambda functions<
/a></td> | 186 <td><a href="http://en.cppreference.com/w/cpp/language/lambda">Lambda functions<
/a></td> |
| 187 <td>Do not bind or store lambdas outside the lifetime of the stack frame they ar
e defined in; use <code>base::Bind</code> and <code>base::Callback</code> instea
d, because they offer protection against a large class of object lifetime mistak
es. Don't use default captures (<code>[=]</code>, <code>[&]</code> – <
a href="https://google.github.io/styleguide/cppguide.html#Lambda_expressions">Go
ogle Style Guide</a>). Lambdas are typically useful as a parameter to methods or
functions that will use them immediately, such as those in <code><algorithm&
gt;</code>. <a href="https://groups.google.com/a/chromium.org/forum/#!topic/chro
mium-dev/D9UnnxBnciQ">Discussion thread</a></td> | 187 <td>Do not bind or store capturing lambdas outside the lifetime of the stack fra
me they are defined in; use captureless lambda with <code>base::Bind</code> and
<code>base::Callback</code> instead, because they offer protection against a lar
ge class of object lifetime mistakes. Don't use default captures (<code>[=]</cod
e>, <code>[&]</code> – <a href="https://google.github.io/styleguide/cp
pguide.html#Lambda_expressions">Google Style Guide</a>). Lambdas are typically u
seful as a parameter to methods or functions that will use them immediately, suc
h as those in <code><algorithm></code>. <a href="https://groups.google.com
/a/chromium.org/forum/#!topic/chromium-dev/D9UnnxBnciQ">Discussion thread</a></t
d> |
| 188 </tr> | 188 </tr> |
| 189 | 189 |
| 190 <tr> | 190 <tr> |
| 191 <td>Local Types as Template Arguments</td> | 191 <td>Local Types as Template Arguments</td> |
| 192 <td><code>void func() {<br /> | 192 <td><code>void func() {<br /> |
| 193 class Pred {<br /> | 193 class Pred {<br /> |
| 194 public:<br /> | 194 public:<br /> |
| 195 bool operator()(const T&) { ... }<br /> | 195 bool operator()(const T&) { ... }<br /> |
| 196 };<br /> | 196 };<br /> |
| 197 std::remove_if(vec.begin(), vec.end(), Pred());</code></td> | 197 std::remove_if(vec.begin(), vec.end(), Pred());</code></td> |
| (...skipping 720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 918 <td><a href="http://en.cppreference.com/w/cpp/locale/wstring_convert">std::wstri
ng_convert</a>, <a href="http://en.cppreference.com/w/cpp/locale/wbuffer_convert
">std::wbuffer_convert</a>, <a href="http://en.cppreference.com/w/cpp/locale/cod
ecvt_utf8">std::codecvt_utf8</a>, <a href="http://en.cppreference.com/w/cpp/loca
le/codecvt_utf16">std::codecvt_utf16</a>, <a href="http://en.cppreference.com/w/
cpp/locale/codecvt_utf8_utf16">std::codecvt_utf8_utf16</a></td> | 918 <td><a href="http://en.cppreference.com/w/cpp/locale/wstring_convert">std::wstri
ng_convert</a>, <a href="http://en.cppreference.com/w/cpp/locale/wbuffer_convert
">std::wbuffer_convert</a>, <a href="http://en.cppreference.com/w/cpp/locale/cod
ecvt_utf8">std::codecvt_utf8</a>, <a href="http://en.cppreference.com/w/cpp/loca
le/codecvt_utf16">std::codecvt_utf16</a>, <a href="http://en.cppreference.com/w/
cpp/locale/codecvt_utf8_utf16">std::codecvt_utf8_utf16</a></td> |
| 919 <td>Non-UTF-8 text is banned by the <a href="https://google.github.io/styleguide
/cppguide.html#Non-ASCII_Characters">Google Style Guide</a>. However, may be use
ful for consuming non-ASCII data.</td> | 919 <td>Non-UTF-8 text is banned by the <a href="https://google.github.io/styleguide
/cppguide.html#Non-ASCII_Characters">Google Style Guide</a>. However, may be use
ful for consuming non-ASCII data.</td> |
| 920 </tr> | 920 </tr> |
| 921 | 921 |
| 922 </tbody> | 922 </tbody> |
| 923 </table> | 923 </table> |
| 924 | 924 |
| 925 </div> | 925 </div> |
| 926 </body> | 926 </body> |
| 927 </html> | 927 </html> |
| OLD | NEW |