
Looks good to me. You might consider a few minor additions:
- A copy constructor for signalling_value, that just copies the underlying value - A copy assignment operator for signalling_value, that just copies the underlying value Both should definitely be there.
- A conversion to const T& (same functionality as get) - An assignment operator that takes a const T& (same functionality as set) I think I prefer forcing users to be specific about what they do, in this case to point out that they are not just setting a value but also possibly signalling receivers. On the other hand, enabling these two features would allow users to treat this class as a regular value in generic programming. Which do you think is better?
4. Do you have a better naming suggestion? Did you consider "observable_value"? Or even just "observable"?
I did, but I wanted to point out that I was using signals and slots. Observable would be great if it was in the namespace boost::signals. Do you think this class might be useful enough to be added to boost slots and signals? Best Regards, Johan Torp