This source file includes following definitions.
- TestDeclarations
- TestNew
- TestTemporaries
- TestWideTemporaries
#include <string>
void TestDeclarations() { std::string a(""), b("abc"), c(""); }
void TestNew() {
std::string* a = new std::string(""),
*b = new std::string("abc"),
*c = new std::string(""),
*d = new std::string();
}
class TestInitializers {
public:
TestInitializers() : a("") {}
TestInitializers(bool) : a(""), b("") {}
TestInitializers(double) : a(""), b("cat"), c() {}
private:
std::string a;
std::string b;
std::string c;
};
void TestTemporaries(const std::string& reference_argument,
const std::string value_argument) {
TestTemporaries("", "");
TestTemporaries(std::string(""), std::string(""));
}
void TestWideTemporaries(const std::wstring& reference_argument,
const std::wstring value_argument) {
TestWideTemporaries(L"", L"");
TestWideTemporaries(std::wstring(L""), std::wstring(L""));
}