|
Boost : |
Subject: Re: [boost] [gsoc16] Can I quickly check if the below really is the best approach?
From: Nevin Liber (nevin_at_[hidden])
Date: 2016-01-14 13:35:33
On 14 January 2016 at 12:09, AgustÃn K-ballo Bergé <kaballo86_at_[hidden]>
wrote:
> "The same thing" than what? It does the exact some thing the macro in this
> context would do:
>
> #define STRING_VIEW(str) { str, sizeof(str)-1 }
Good point.
The question is: what should it do? There are three interpretations:
C-string literal ('\0'-terminated array that may have embedded '\0' bytes)
array (no sentinel terminates the array)
C-string (terminate the string at the first '\0' encountered)
I suppose the one that makes the most sense is C-string literal (which is
what the macro and your code does).
Doesn't Boost.Range have to deal with this also?
-- Nevin ":-)" Liber <mailto:nevin_at_[hidden]> +1-847-691-1404
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk