Skip to content

fix bug:std::vector初始化后再emplace导致vector大小翻倍的问题 #674

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: cpp17
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions muduo/base/tests/BoundedBlockingQueue_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ class Test
{
char name[32];
snprintf(name, sizeof name, "work thread %d", i);
threads_.emplace_back(new muduo::Thread(
std::bind(&Test::threadFunc, this), muduo::string(name)));
threads_[i] = std::make_unique<muduo::Thread>(std::bind(&Test::threadFunc, this),
muduo::string(name));
}
for (auto& thr : threads_)
{
Expand Down