3 Nov
2013
3 Nov
'13
10:07 p.m.
On 2 November 2013 10:27, Domagoj Saric wrote:
On 2.11.2013. 0:42, Michael Marcin wrote:
I noticed string_ref doesn't have a constructor for a string literal. Wouldn't this save a call to strlen for a common case?
You first have to find a compiler that does not already eliminate the strlen ;)
Indeed, the strlen call on a string literal can (and should) be optimised away, so the current constructor should already produce the optimal result.