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() {}
TestInitializers(bool) {}
TestInitializers(double) : 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(std::string(), std::string());
TestTemporaries(std::string(), std::string());
}
void TestWideTemporaries(const std::wstring& reference_argument,
const std::wstring value_argument) {
TestWideTemporaries(std::wstring(), std::wstring());
TestWideTemporaries(std::wstring(), std::wstring());
}