unordered_map::operator[] - C++ Reference
Search: Reference unordered_map operator[] Not logged in register log in public member function std::unordered_map::operator[] mapped_type& operator[] ( const key_type& k ); mapped_type& operator[] ( key_type&& k ); Access element If k matches the key of an element in the container, the function returns a reference to its mapped value. If k does not match the key of any element in the container, the function inserts a new element with that key and returns a reference to its mapped value. Notice that this always increases the container size by one, even if no mapped value is assigned to the element (the element is constructed using its default constructor). A similar member function, unordered_map::at, has the same behavior when an element with the key exists, but throws an exception when it does not. Parameters k Key value of the element whose mapped value is accessed. Member type key_type is the type of the keys for the elements stored in the con
TUTORIALS REFERENCE ARTICLES FORUM C++ Tutorials Reference Articles Forum Reference C library: <cassert> (assert.h) <cctype> (ctype.h) <cerrno> (errno.h) C++11 <cfenv> (fenv.h) <cfloat> (float.h) C++11 <cinttypes> (inttypes.h) <ciso646> (iso646.h) <climits> (limits.h) <clocale> (locale.h) <cmath> (math.h) <csetjmp> (setjmp.h) <csignal> (signal.h) <cstdarg> (stdarg.h) C++11 <cstdbool> (stdbool.h) <cstddef> (stddef.h) C++11 <cstdint> (stdint.h) <cstdio> (stdio.h) <cstdlib> (stdlib.h) <cstring> (string.h) C++11 <ctgmath> (tgmath.h) <ctime> (time.h) C++11 <cuchar> (uchar.h) <cwchar> (wchar.h) <cwc
Explore this link on the map →related reading
- HashMap in std::collections - Rustdoc.rust-lang.org
- list - C++ Referencecplusplus.com
- sort - C++ Referencecplusplus.com
- Build Your Own Databasenan.fyi
- priority_queue - C++ Referencecplusplus.com
- Go Mapsw3schools.com
- Learn C++ – Skill up with our free tutorialslearncpp.com
- CS106B C++ Stringsweb.stanford.edu
- Go maps in action - The Go Programming Languagego.dev
- Go Maps Explained: How Key-Value Pairs Are Actually Storedvictoriametrics.com
- Rust Iterator Cheat Sheetdanielkeep.github.io
- partial_sort - C++ Referencecplusplus.com