Skip to content

Allow size calculators to fail to determine the size #114

@eyalroz

Description

@eyalroz

The "size calculator" we support for parameters can either be missing - in which case we derive the size some other way - or it is required to return a valid value. But - what if the size calculator relies on an argument that is sometimes present and sometimes missing? Or what if the size can sometimes be determined with certainty and in other cases is ambiguous?

We should make the size calculator functions return an optional<size_t>, and the code which uses them to treat the case of a size calculator returning nullopt as it does the case of the parameter not having a size calculator to begin with.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions