mirror of
https://github.com/CnTransGroup/EffectiveModernCppChinese.git
synced 2025-01-04 01:10:24 +08:00
deploy: c4295e5ab4
This commit is contained in:
parent
a516926297
commit
098fceafe5
@ -164,7 +164,7 @@ logAndAdd("Patty Dog"); //传递字符串字面值
|
|||||||
<pre><code class="language-cpp">template<typename T>
|
<pre><code class="language-cpp">template<typename T>
|
||||||
void logAndAdd(T&& name)
|
void logAndAdd(T&& name)
|
||||||
{
|
{
|
||||||
auto now = std::chrono::system_lock::now();
|
auto now = std::chrono::system_clock::now();
|
||||||
log(now, "logAndAdd");
|
log(now, "logAndAdd");
|
||||||
names.emplace(std::forward<T>(name));
|
names.emplace(std::forward<T>(name));
|
||||||
}
|
}
|
||||||
@ -181,7 +181,7 @@ logAndAdd("Patty Dog"); //在multiset直接创建std::
|
|||||||
|
|
||||||
void logAndAdd(int idx) //新的重载
|
void logAndAdd(int idx) //新的重载
|
||||||
{
|
{
|
||||||
auto now = std::chrono::system_lock::now();
|
auto now = std::chrono::system_clock::now();
|
||||||
log(now, "logAndAdd");
|
log(now, "logAndAdd");
|
||||||
names.emplace(nameFromIdx(idx));
|
names.emplace(nameFromIdx(idx));
|
||||||
}
|
}
|
||||||
|
@ -3685,7 +3685,7 @@ logAndAdd("Patty Dog"); //传递字符串字面值
|
|||||||
<pre><code class="language-cpp">template<typename T>
|
<pre><code class="language-cpp">template<typename T>
|
||||||
void logAndAdd(T&& name)
|
void logAndAdd(T&& name)
|
||||||
{
|
{
|
||||||
auto now = std::chrono::system_lock::now();
|
auto now = std::chrono::system_clock::now();
|
||||||
log(now, "logAndAdd");
|
log(now, "logAndAdd");
|
||||||
names.emplace(std::forward<T>(name));
|
names.emplace(std::forward<T>(name));
|
||||||
}
|
}
|
||||||
@ -3702,7 +3702,7 @@ logAndAdd("Patty Dog"); //在multiset直接创建std::
|
|||||||
|
|
||||||
void logAndAdd(int idx) //新的重载
|
void logAndAdd(int idx) //新的重载
|
||||||
{
|
{
|
||||||
auto now = std::chrono::system_lock::now();
|
auto now = std::chrono::system_clock::now();
|
||||||
log(now, "logAndAdd");
|
log(now, "logAndAdd");
|
||||||
names.emplace(nameFromIdx(idx));
|
names.emplace(nameFromIdx(idx));
|
||||||
}
|
}
|
||||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user