String front, back return code point/unit

vit vit at vit.vit
Wed Jun 23 16:01:24 UTC 2021


On Wednesday, 23 June 2021 at 15:48:57 UTC, Tejas wrote:
> On Wednesday, 23 June 2021 at 15:31:04 UTC, vit wrote:
>> Hello,
>>
>> I am implementing @nogc string struct similar to c++ 
>> std::basic_string (link 
>> https://code.dlang.org/packages/basic_string).
>>
>> C++ string has methods front, back and pop_back 
>> returning/deleting code units.
>> D strings has functions (std.range) front, back and popBack 
>> returning/deleting code points (autodecoding?).
>>
>> Which behavior is better?
>
> I think this video will be helpful:
> https://www.youtube.com/watch?v=d3qY4dZ2r4w
>
> There was also a discussion about this in the group: 
> https://forum.dlang.org/thread/diexjstekiyzgxlicnts@forum.dlang.org

I wrongly formulated question.

My question is not about ranges/iterators but if is good idea 
autodecoding custom string or not.



More information about the Digitalmars-d-learn mailing list