Created
October 9, 2019 04:38
-
-
Save roshanrags/d73b15566e2da1702c21258fc2f0ac10 to your computer and use it in GitHub Desktop.
A small snippet with cppcheck FP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template<class... Args> | |
std::pair<TransportType *, bool> get_or_create( | |
SocketAddress const &addr, | |
Args&&... args | |
) { | |
auto [iter, res] = transport_map.try_emplace( | |
addr, | |
std::forward<Args>(args)... | |
); | |
return std::make_pair(&iter->second, res); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here's the diagnostic from cppcheck: