Boost logo

Boost Users :

From: Pavol Droba (droba_at_[hidden])
Date: 2008-01-16 05:24:30


Hi,

Thorsten Ottosen wrote:
> Pavol Droba skrev:
>> Hi,
>>
>> Thorsten Ottosen wrote:
>
>>> I agree we could add a new function. Can we come up with a better name
>>> than as_c_str()?
>>>
>>> Or should we simply make as_literal() scan the array?
>>>
>> I think, that as_literal should behave the same way for character arrays
>> and for c-string. Different behaviour is unexpexted here.
>>
>> The only difference that could be beneficial is that for arrays, the
>> scanning for nulls can be bounded to protect agains the buffer overruns.
>
> By an assertion, I pressume.

Not necessary. Why couldn't we take the whole array as a string when no
null character is present?

I don't see any problem with this approach.

>
> Would you commit a fix to trunk then?
>

I can have a look at it.

Regards,

Pavol.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net