mirror of
https://github.com/CnTransGroup/EffectiveModernCppChinese.git
synced 2024-12-25 20:30:21 +08:00
Fix typo in example code in item26
This commit is contained in:
parent
45f9d5fec0
commit
c4295e5ab4
@ -36,7 +36,7 @@ logAndAdd("Patty Dog"); //传递字符串字面值
|
||||
template<typename T>
|
||||
void logAndAdd(T&& name)
|
||||
{
|
||||
auto now = std::chrono::system_lock::now();
|
||||
auto now = std::chrono::system_clock::now();
|
||||
log(now, "logAndAdd");
|
||||
names.emplace(std::forward<T>(name));
|
||||
}
|
||||
@ -57,7 +57,7 @@ std::string nameFromIdx(int idx); //返回idx对应的名字
|
||||
|
||||
void logAndAdd(int idx) //新的重载
|
||||
{
|
||||
auto now = std::chrono::system_lock::now();
|
||||
auto now = std::chrono::system_clock::now();
|
||||
log(now, "logAndAdd");
|
||||
names.emplace(nameFromIdx(idx));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user