String literals have only one instance?

Rory Mcguire rjmcguire at gm_no_ail.com
Thu Aug 19 00:53:40 PDT 2010


Are all string literals that have the same value initialized to the same 
address?

void main() {
	string same() {
		return "This";
	}
	assert("This" is same());
	assert("This" is "This");
}


Can this be relied upon?


More information about the Digitalmars-d-learn mailing list