@SimonSchroeder thank you for the detailed reply.
I'm not averse to using lambda functions (I wholeheartedly agree with you on the subject of using "new" language features, even if they raise the complexity bar a bit). What I was really hoping for was a way to eliminate the type-specific code like this:
struct Foo { void compareAndSet(double val) { compareNotify(m_value, int(val), 1, this, &Foo::intValueChanged); compareNotify(m_dblValue, double(val), 0.5, this, &Foo::doubleValueChanged);So that my compareNotify could be truly type-agnostic. Perhaps what I'm looking for just isn't feasible, which is fine. The solution that @Christian-Ehrlicher is more than adequate; I was just exploring whether there was another way to do this.
I am not a computer scientist by education, and most of what I know is self-taught. C always made innate sense to me, and the early principles of C++ were logical enough. Some of the more modern stuff, though, is a little unintuitive to me. I'm just an old dog trying to learn a few new tricks.
EDIT:
another note: given that there are only a handful of types in the language, what I'm looking for might be overkill, and might be sacrificing code clarity for universality -- almost never a good trade.