> (2) Needs Information: We potentially don't need to use ObserverId. The
> std::function is already unique and has operator== so could be used as the
> identifier itself...
> 48 + virtual scene::ObserverId
> add_change_callback(std::function<void()> const& f) = 0;
> 49 + virtual void remove_change_callback(scene::ObserverId id) = 0;
> Then notify_change_by_id could become a std::set with a custom Compare
> template parameter. Or more simply a std::list with std::find.
>
This imposes the caller to save the std::function it passed even if they are lambdas, which is probably more awkward than obtaining an id.
> (2) Needs Information: We potentially don't need to use ObserverId. The callback( std::function< void()> const& f) = 0; change_ callback( scene:: ObserverId id) = 0;
> std::function is already unique and has operator== so could be used as the
> identifier itself...
> 48 + virtual scene::ObserverId
> add_change_
> 49 + virtual void remove_
> Then notify_change_by_id could become a std::set with a custom Compare
> template parameter. Or more simply a std::list with std::find.
>
This imposes the caller to save the std::function it passed even if they are lambdas, which is probably more awkward than obtaining an id.