Click here to Skip to main content
15,892,199 members
Articles / Programming Languages / C++

One Line Solution to a Common Map Search Paradigm

Rate me:
Please Sign up or sign in to vote.
5.00/5 (6 votes)
3 Nov 2016CPOL 11.3K  
There is an efficient way provided by std::map to solve a common programming pattern ("query-and-insert-if-nonexistent")

Views

Daily Counts

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Technical Lead National Instruments
China China
Senior software engineer at National Instruments, to implement various Ethernet-based industrial protocols, e.g., EtherCAT. Favorite languages are C/C++ and Python. For fun, I like watching films (sci-fi, motion), walking, and various reading.

Comments and Discussions