Top "Stdstring" questions

std::string is the C++ standard library's byte-based "string" type, defined in the <string> header.

Encode/Decode std::string to UTF-16

I have to handle a file format (both read from and write to it) in which strings are encoded in …

c++ utf-16 stdstring
Reading directly from an std::istream into an std::string

Is there anyway to read a known number of bytes, directly into an std::string, without creating a temporary buffer …

c++ stdstring iostream
Length of a C++ std::string in bytes

I'm having some trouble figuring out the exact semantics of std::string.length(). The documentation explicitly points out that length() …

c++ string stdstring
Append int to std::string

I tried two different ways to append an int to a std::string, and to my surprise, I got different …

c++ stdstring
Explicit copy constructor

I have extended std::string to fulfil my needs of having to write custom function build into string class called …

c++ copy-constructor assignment-operator stdstring explicit
Put first boost::regex match into a string

Somehow, I've failed to find out, how to put only the first occurrence or regular expression to string. I can …

c++ stdstring boost-regex
Is there a way to get std:string's buffer

Is there a way to get the "raw" buffer o a std::string? I'm thinking of something similar to CString::…

c++ winapi stl stdstring
Does std::atomic<std::string> work appropriately?

I am reading through Anthony Williams' "C++ Concurrency in Action" and in Chapter 5, which talks about the new multithreading-aware memory …

c++ atomic stdstring stdatomic
Initialize std::string from a possibly NULL char pointer

Initializing std::string from a NULL char pointer is undefined behaviour, I believe. So, here are alternative versions of a …

c++ null stdstring
Proper way to do const std::string in a header file?

I'm writing a Cocos2D-X game where the player, enemies and other characters store their attributes in a CCMutableDictionary, which …

c++ static constants stdstring