Skip to content

Internal: load_be/le should accept a BufferSlicer #4068

@reneme

Description

@reneme

Additional context here: #3716 (comment)

TL;DR: Reduce the boiler-plate when loading integers of a statically known bitlength from a buffer:

// currently
auto a = load_be<uint32_t>(slicer.take<4>());
auto b = load_be<SomeStrongIntegerType>(slicer.take<sizeof(SomeStrongIntegerType)>());

// then
auto a = load_be<uint32_t>(slicer);
auto b = load_be<SomeStrongIntegerType>(slicer);

Note that the BufferSlicer is currently part of stl_util.h which we may or may not want to include in loadstor.h. Perhaps it makes sense to move the BufferSlicer, BufferStuffer and concat() into their own dedicated header.

Metadata

Metadata

Assignees

Labels

enhancementEnhancement or new feature

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions