-
Notifications
You must be signed in to change notification settings - Fork 645
Internal: load_be/le should accept a BufferSlicer #4068
Copy link
Copy link
Open
Labels
enhancementEnhancement or new featureEnhancement or new feature
Description
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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementEnhancement or new featureEnhancement or new feature