mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2024-03-22 13:30:58 +08:00
Fix cpplint issues
Rconc-create0.cpp:20: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] Res-always5.cpp:15: Missing space after , [whitespace/comma] [3] Rp-lib0.cpp:15: Missing space after , [whitespace/comma] [3] Rs-using-directive0.cpp:25: Extra space after ( in function call [whitespace/parens] [4] Rs-using-directive0.cpp:25: Extra space before ) [whitespace/parens] [2]
This commit is contained in:
parent
48b40df328
commit
a2dba2e78b
|
@ -1067,7 +1067,7 @@ So, if a suitable library exists for your application domain, use it.
|
|||
|
||||
##### Example
|
||||
|
||||
std::sort(begin(v),end(v),std::greater<>());
|
||||
std::sort(begin(v), end(v), std::greater<>());
|
||||
|
||||
Unless you are an expert in sorting algorithms and have plenty of time,
|
||||
this is more likely to be correct and to run faster than anything you write for a specific application.
|
||||
|
@ -9105,7 +9105,7 @@ Readability. Minimize resource retention.
|
|||
|
||||
Note: C++17 also adds `if` and `switch` initializer statements. These require C++17 support.
|
||||
|
||||
map<int,string> mymap;
|
||||
map<int, string> mymap;
|
||||
|
||||
if (auto result = mymap.insert(value); result.second) {
|
||||
// insert succeeded, and result is valid for this block
|
||||
|
@ -9508,7 +9508,7 @@ Assuming that there is a logical connection between `i` and `j`, that connection
|
|||
|
||||
Obviously, what we really would like is a construct that initialized n variables from a `tuple`. For example:
|
||||
|
||||
auto [i,j] = make_related_widgets(cond); // C++17, not C++14
|
||||
auto [i, j] = make_related_widgets(cond); // C++17, not C++14
|
||||
|
||||
Today, we might approximate that using `tie()`:
|
||||
|
||||
|
@ -12494,8 +12494,7 @@ Thread creation is expensive.
|
|||
// process
|
||||
}
|
||||
|
||||
void
|
||||
(istream& is)
|
||||
void master(istream& is)
|
||||
{
|
||||
for (Message m; is >> m; )
|
||||
run_list.push_back(new thread(worker, m));
|
||||
|
@ -16574,10 +16573,10 @@ Doing so takes away an `#include`r's ability to effectively disambiguate and to
|
|||
// user.cpp
|
||||
#include "bad.h"
|
||||
|
||||
bool copy( /*... some parameters ...*/); // some function that happens to be named copy
|
||||
bool copy(/*... some parameters ...*/); // some function that happens to be named copy
|
||||
|
||||
int main() {
|
||||
copy( /*...*/ ); // now overloads local ::copy and std::copy, could be ambiguous
|
||||
copy(/*...*/); // now overloads local ::copy and std::copy, could be ambiguous
|
||||
}
|
||||
|
||||
##### Enforcement
|
||||
|
|
Loading…
Reference in New Issue
Block a user