In C++03, boost::hash
. In C++11, std::hash
.
std::hash<std::string>()("foo");
More Related Contents:
- Fast String Hashing Algorithm with low collision rates with 32 bit integer [closed]
- Hash function for a string
- What is the most efficient C++ method to split a string based on a particular delimiter similar to split method in python? [closed]
- cannot convert ‘std::string’ to ‘char**’ for argument ‘1’ to ‘__ssize_t getline(char**, size_t*, FILE*)’
- Why when i add number to string it shows random text in c++?
- Converting a hex string to a byte array
- How do I iterate over cin line by line in C++?
- Converting std::__cxx11::string to std::string
- Is a string literal in С++ created in static memory?
- Will std::string always be null-terminated in C++11?
- What’s the rationale for null terminated strings?
- Sizeof string literal
- stringstream, string, and char* conversion confusion
- How to compare multiple strings inside an if statement?
- How to implode a vector of strings into a string (the elegant way)
- Convert a string to a date in C++
- std::strings’s capacity(), reserve() & resize() functions
- splitting a string into an array in C++ without using vector
- Most optimized way of concatenation in strings
- How do I print the full value of a long string in gdb?
- Why does calling std::string.c_str() on a function that returns a string not work?
- comparison between string literal
- Convert std::string to QString
- How do you validate that a string is a valid IPv4 address in C++?
- “to_string” isn’t a member of “std”?
- Parse string containing numbers into integer array
- C++ Passing std::string by reference to function in dll
- Concatenate compile-time strings in a template at compile time?
- C++ most efficient way to convert string to int (faster than atoi)
- How do I include the string header?