mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-19 09:53:08 +02:00
use emplace
Allows removing the constructor name as emplace forwards the arguments directly. Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
parent
bf93c28919
commit
5c137f5c8f
9 changed files with 24 additions and 24 deletions
|
@ -105,7 +105,7 @@ int main (int, char**)
|
|||
while (l2.token (token, type))
|
||||
{
|
||||
std::cout << "# «" << token << "» " << Lexer::typeName (type) << "\n";
|
||||
tokens.push_back (std::pair <std::string, Lexer::Type> (token, type));
|
||||
tokens.emplace_back (token, type);
|
||||
}
|
||||
|
||||
t.is (tokens[0].first, "one", "tokens[0] = 'one'"); // 30
|
||||
|
@ -147,7 +147,7 @@ int main (int, char**)
|
|||
while (l3.token (token, type))
|
||||
{
|
||||
std::cout << "# «" << token << "» " << Lexer::typeName (type) << "\n";
|
||||
tokens.push_back (std::pair <std::string, Lexer::Type> (token, type));
|
||||
tokens.emplace_back (token, type);
|
||||
}
|
||||
|
||||
t.is ((int)tokens.size (), 7, "7 tokens");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue