Refactoring #1748

Consider IParameter storing the data by reference

Added by pospelov about 4 years ago. Updated over 3 years ago.

Status:RejectedStart date:18 Jan 2017
Priority:NormalDue date:
Assignee:-% Done:


Target version:-


Suggestion: instead of

template<typename T>
IParameter {
    IParameter(string name, T* data)
   T* m_data;

use the reference

template<typename T>
IParameter {
    IParameter(string name, T& data)
   T& m_data;
  • Few lines code less in RealParameter
    • No need to check if pointer != nullptr, and to provide machinery for pointing RealParameter to another source.
  • It is one character less to type while registering parameters: registerParameter(m_width) instead of registerParameter(&m_width)

From another hand, lots of files will be changed, without no strong reason.

Another thing to have in mind: for the moment RealParameter doesn't provide any defense against parent IParameterized being deleted. Shall we think of such defense?


#1 Updated by pospelov over 3 years ago

  • Status changed from Rfc to Rejected

Also available in: Atom PDF