boostorg / pfr

std::tuple like methods for user defined types without any macro or boilerplate code

Home Page:https://boost.org/libs/pfr

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to compare each member of two identical structure values?

SpriteOvO opened this issue · comments

commented

I'm writing a Settings feature for my program. After the members are modified at runtime and committed, I need to compare them and call the member handler for each modified member.

A simplified short example: https://godbolt.org/z/Y7PKbrqe5

pfr::get only accepts an index as a non-type template parameter, so I obviously can't enumerate at runtime with fields_count.
I didn't find a solution from the docs, am I missing something?

Any help would be appreciated.

commented

Oh, I found an existing issue #69, sorry to open this new one.