Returning sigc::signal by value from a const method?



I'm wondering about this for a project I'm writing. Would this be considered bad style? It's certainly possible (as signal is copyable, and many mm classes return it by value from non-const methods), but is it bad design for any reason?

My line of thought is that the signals only observe the object that emits them, so registering to be notified of changes is not modifying the emitter.

Letting a const instance return signals for observers to connect to would mean that I would not have to e.g. pass my model objects to my view objects by non-const reference, which I don't like the look of and can result in me having to cascade that non-constness all over the place.

Any thoughts welcome!



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]