mirror of
https://github.com/google/styleguide.git
synced 2024-03-22 13:11:43 +08:00
Update C++ style guide to 3.171:
- Add a section to specify deprecation comments.
This commit is contained in:
parent
b6870cb5db
commit
b729e3cfe3
41
cppguide.xml
41
cppguide.xml
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
<p align="right">
|
<p align="right">
|
||||||
|
|
||||||
Revision 3.170
|
Revision 3.171
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
||||||
|
@ -3477,6 +3477,43 @@ Tashana Landray
|
||||||
</BODY>
|
</BODY>
|
||||||
</STYLEPOINT>
|
</STYLEPOINT>
|
||||||
|
|
||||||
|
<STYLEPOINT title="Deprecation Comments">
|
||||||
|
<SUMMARY>
|
||||||
|
Mark deprecated interface points with <code>DEPRECATED</code> comments.
|
||||||
|
</SUMMARY>
|
||||||
|
<BODY>
|
||||||
|
<p>
|
||||||
|
You can mark an interface as deprecated by writing a comment containing
|
||||||
|
the word <code>DEPRECATED</code> in all caps. The comment goes either
|
||||||
|
before the declaration of the interface or on the same line as the
|
||||||
|
declaration.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
After the word <code>DEPRECATED</code>, write your name, e-mail address,
|
||||||
|
or other identifier in parentheses.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
A deprecation comment must include simple, clear directions for people to
|
||||||
|
fix their callsites. In C++, you can implement a deprecated function as
|
||||||
|
an inline function that calls the new interface point.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
Marking an interface point <code>DEPRECATED</code> will not magically
|
||||||
|
cause any callsites to change. If you want people to actually stop using
|
||||||
|
the deprecated facility, you will have to fix the callsites yourself or
|
||||||
|
recruit a crew to help you.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
New code should not contain calls to deprecated interface points. Use
|
||||||
|
the new interface point instead. If you cannot understand the
|
||||||
|
directions, find the person who created the deprecation and ask them for
|
||||||
|
help using the new interface point.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
</BODY>
|
||||||
|
</STYLEPOINT>
|
||||||
|
|
||||||
</CATEGORY>
|
</CATEGORY>
|
||||||
|
|
||||||
<CATEGORY title="Formatting">
|
<CATEGORY title="Formatting">
|
||||||
|
@ -4514,7 +4551,7 @@ Tashana Landray
|
||||||
<HR/>
|
<HR/>
|
||||||
|
|
||||||
<p align="right">
|
<p align="right">
|
||||||
Revision 3.170
|
Revision 3.171
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<HTML xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcq="http://purl.org/dc/qualifiers/1.0/" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:fn="http://www.w3.org/2005/xpath-functions">
|
<HTML xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcq="http://purl.org/dc/qualifiers/1.0/" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:fn="http://www.w3.org/2005/xpath-functions">
|
||||||
<HEAD>
|
<HEAD>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
|
||||||
<TITLE>Google Python Style Guide</TITLE>
|
<TITLE>Google Python Style Guide</TITLE>
|
||||||
|
<META http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<LINK HREF="http://www.google.com/favicon.ico" type="image/x-icon" rel="shortcut icon">
|
<LINK HREF="http://www.google.com/favicon.ico" type="image/x-icon" rel="shortcut icon">
|
||||||
<LINK HREF="styleguide.css" type="text/css" rel="stylesheet">
|
<LINK HREF="styleguide.css" type="text/css" rel="stylesheet">
|
||||||
<SCRIPT language="javascript" type="text/javascript">
|
<SCRIPT language="javascript" type="text/javascript">
|
||||||
|
|
Loading…
Reference in New Issue
Block a user