Skip to content

read evaluation order #8

Description

@rykovv

What is evaluated first by eval? reads or writes? The order matters, especially when the same register/field is written and read.

Currently, the default behavior is to read first and return the "old" value, as it doesn't make sense to return value being written. This issue introduces choice to the user:

// return old value of mode
auto v = eval<pre>(cfg.mode, cfg.mode = 1_f);

// return read value of mode after write
auto v = eval<post>(cfg.mode, cfg.mode = 1_f);

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions