Skip to content

TypeChangingRangeChecking decorator throws boost::numeric::{postive|negative}_overflow in preWrite #37

@phako

Description

@phako

If the exposed type is smaller than the wrapped type, Trying to write a value that exceeds the limits of the wrapped type will cause preWrite() to throw a boost::numeric::positive_overflow or ::negative_overflow.

This violates the TransferElement specification

If we do not declare it obsolete completely, the RangeChecking type should check type sizes on construction depending on its direction:

  • rw is illegal
  • ro widens the type from target type to decorator type (Example: target is uint8_t, decorator is int)
  • wo narrows the type from target type to decorator type (Example: target is double, decorator is float)

such that range issues during the runtime cannot happen.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions