Seeking help with opend std
monkyyy
crazymonkyyy at gmail.com
Mon Jan 13 20:33:50 UTC 2025
On Monday, 13 January 2025 at 12:26:07 UTC, Anton Pastukhov wrote:
> On Sunday, 12 January 2025 at 20:40:06 UTC, monkyyy wrote:
>> On Sunday, 12 January 2025 at 19:25:37 UTC, Anton Pastukhov
>> wrote:
>>> On Saturday, 11 January 2025 at 05:12:02 UTC, monkyyy wrote:
>>>> On Friday, 27 December 2024 at 21:15:40 UTC, monkyyy wrote:
>>>>>
>>>>
>>>> Still want help
>>>>
>>>> https://github.com/opendlang/d/blob/main/source/odc/algorthims.d
>>>>
>>>> will take criticism from the usual suspects
>>>
>>> Please make popFront and popBack actually return popped
>>> values thanks
>>
>> Even if I liked that idea, wouldnt that break phoboes
>> compatibility?
>
> My uninformed opinion is that shouldn't cause too much trouble?
> popFront and popBack currently return void, so it's safe to
> assume there are no places in the existing code that expect a
> return value, so it's just going to be discarded. I could be
> terribly wrong ofc
I believe phoboes and "contract programming" to break code that
should otherwise work(I know of spefic examples where coping and
pasting the function without the contract compiles)
Its possible to detect differences here and the real code range
api that actually being used by phoebes is actually oo-y
If you care about the api I could add some variant of this
function:
```d
auto ref next(R)(R r){
auto e=&(r.front);
r.popFront;
return *e;
}
```
(would need to test several situation to find version that
actually works with both ref and nonref front)
More information about the Digitalmars-d
mailing list