FYI: Use std::pair(a, b), not std::make_pair(a, b)

11 views
Skip to first unread message

Adam Rice

unread,
Jun 25, 2024, 12:08:45 AM (8 days ago) Jun 25
to net-dev
Since https://chromium-review.googlesource.com/c/chromium/src/+/5208390 //net has been using the std::pair constructor with type inference instead of using std::make_pair. For consistency, I'd like everyone to use std::pair from now on in //net. It's simple. Instead of

std::make_pair(7, "words")

write

std::pair(7, "words")

which does the same thing.

If you're interested in how the type deduction is done, see https://en.cppreference.com/w/cpp/utility/pair/deduction_guides.

Reply all
Reply to author
Forward
0 new messages