search for: astringref

Displaying 3 results from an estimated 3 matches for "astringref".

Did you mean: stringref
2011 Jul 18
3
[LLVMdev] Correct use of StringRef and Twine
...storage? In the common/correct use case (taking a Twine as a const ref, or using a Twine entirely in a temporary concatenation expression) wouldn't the Twine's internal storage live long enough to allow the caller to use that buffer within the life of the statement (as in, say, o << (aStringRef + "foo"))? This last one is probably the bigger question & relates to the other two. It seems like Twine is nice for cases where deferred concatenation is required & might be able to be avoided altogether - if the majority case is that the concatenation ends up being thrown away,...
2011 Jul 19
0
[LLVMdev] Correct use of StringRef and Twine
...storage? In the common/correct use case (taking a Twine as a const ref, or using a Twine entirely in a temporary concatenation expression) wouldn't the Twine's internal storage live long enough to allow the caller to use that buffer within the life of the statement (as in, say, o << (aStringRef + "foo"))? This is really dangerous. I'd much rather extend raw_ostream to take twines. > This last one is probably the bigger question & relates to the other two. It seems like Twine is nice for cases where deferred concatenation is required & might be able to be avoid...
2011 Jul 19
3
[LLVMdev] Correct use of StringRef and Twine
...storage? In the common/correct use case (taking a Twine as a const ref, or using a Twine entirely in a temporary concatenation expression) wouldn't the Twine's internal storage live long enough to allow the caller to use that buffer within the life of the statement (as in, say, o << (aStringRef + "foo"))? > > This is really dangerous. Is it much/any more dangerous than Twine's existing functionality, though? Twine's already referring to temporaries & will break in fun ways if used outside that cliche. > I'd much rather extend raw_ostream to take twines...