Title: [117866] trunk/Websites/webkit.org
- Revision
- 117866
- Author
- [email protected]
- Date
- 2012-05-21 18:45:24 -0700 (Mon, 21 May 2012)
Log Message
Style guide change: Uses of "std::" should be explicitly qualified.
https://bugs.webkit.org/show_bug.cgi?id=87043
Patch by Peter Kasting <[email protected]> on 2012-05-21
Reviewed by Ryosuke Niwa.
* coding/coding-style.html:
Modified Paths
Diff
Modified: trunk/Websites/webkit.org/ChangeLog (117865 => 117866)
--- trunk/Websites/webkit.org/ChangeLog 2012-05-22 01:36:43 UTC (rev 117865)
+++ trunk/Websites/webkit.org/ChangeLog 2012-05-22 01:45:24 UTC (rev 117866)
@@ -1,3 +1,12 @@
+2012-05-21 Peter Kasting <[email protected]>
+
+ Style guide change: Uses of "std::" should be explicitly qualified.
+ https://bugs.webkit.org/show_bug.cgi?id=87043
+
+ Reviewed by Ryosuke Niwa.
+
+ * coding/coding-style.html:
+
2012-05-11 Darin Adler <[email protected]>
Try to make spacing of fine print items in lower left nicer looking.
Modified: trunk/Websites/webkit.org/coding/coding-style.html (117865 => 117866)
--- trunk/Websites/webkit.org/coding/coding-style.html 2012-05-22 01:36:43 UTC (rev 117865)
+++ trunk/Websites/webkit.org/coding/coding-style.html 2012-05-22 01:45:24 UTC (rev 117866)
@@ -951,21 +951,21 @@
</pre>
</li>
-<li id="using-in-cpp">In C++ implementation files, do not use statements of the form
-"using std::foo" to import names in the standard template library.
-Use "using namespace std" instead.
+<li id="using-in-cpp">In C++ implementation files, do not use "using" declarations
+of any kind to import names in the standard template library. Directly qualify
+the names at the point they're used instead.
<h4 class="right">Right:</h4>
<pre class="code">
// HTMLBaseElement.cpp
-using namespace std;
-
namespace WebCore {
+ std::swap(a, b);
+ c = std::numeric_limits<int>::max()
+
} // namespace WebCore
</pre>
-
<h4 class="wrong">Wrong:</h4>
<pre class="code">
// HTMLBaseElement.cpp
@@ -974,8 +974,22 @@
namespace WebCore {
+ swap(a, b);
+
} // namespace WebCore
</pre>
+<h4 class="wrong">Wrong:</h4>
+<pre class="code">
+// HTMLBaseElement.cpp
+
+using namespace std;
+
+namespace WebCore {
+
+ swap(a, b);
+
+} // namespace WebCore
+</pre>
</li>
<li id="using-nested-namespaces">In implementation files, if a "using namespace" statement is
@@ -1013,7 +1027,7 @@
<pre class="code">
// HTMLSelectElement.cpp
-using namespace std;
+using namespace other;
namespace WebCore {
@@ -1026,7 +1040,7 @@
namespace WebCore {
-using namespace std;
+using namespace other;
} // namespace WebCore
</pre>
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes