read/peek and automatically advance index in buffer

jwatson-CO-edu real.name at colorado.edu
Thu Mar 16 21:10:13 UTC 2023


On Thursday, 16 March 2023 at 18:58:18 UTC, ag0aep6g wrote:
> On Thursday, 16 March 2023 at 18:39:00 UTC, jwatson-CO-edu 
> wrote:
>> ```d
>> int rtnVal = buffer.peek(int,Endian.bigEndian)(&marker);
>> // Error: found `,` when expecting `.` following int
>> ```
>
> You just forgot the exclamation mark there.

"there" was not descriptive in this context, but I was able to 
infer what you meant by trial and error. The following gives me 
the behavior I needed:

```d
int rtnVal = buffer.peek!(int, Endian.bigEndian)(&marker);
```



More information about the Digitalmars-d-learn mailing list