|
Boost : |
Subject: Re: [boost] [program_options] Some methods take const char*, others take std::string
From: Olaf van der Spek (ml_at_[hidden])
Date: 2011-08-24 15:22:44
On Wed, Aug 24, 2011 at 5:27 PM, Yakov Galka <ybungalobill_at_[hidden]> wrote:
> 2) Yes, it treats string literals as arrays, so what? It's exactly what we
> want.
No, because it'll include the null terminator.
> If you're talking about including or not the null terminator, then I'm still
> not sure on this point. We can say that our strings don't contain zeros in
> the middle (which is acceptable for function expecting const char*), then if
It'd be nice to support 'binary' strings too.
> end() points to a null terminator we can use it as an optimization when
end() will point one past the terminator.
> 3) No, iterator_range just stores a pair of iterators, no memory allocations
> are done. Also see 1), it's irrelevant to the discussion.
Ah, I think I'm confused with another type then.
Olaf
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk