Encapsulation? not

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Encapsulation? not

Luigi Ballabio-4
Hi all,

class Path {
   public:
     ...
     const std::vector<Time>& times() const;
     std::vector<Time>& times();
     const Array& drift() const;
     Array& drift();
     const Array& diffusion() const;
     Array& diffusion();
   private:
     std::vector<Time> times_;
     Array drift_;
     Array diffusion_;
};

This is kind of silly. We aren't encapsulating anything this way.
Any objection to recode the above as:

class Path {
   public:
     ...
     std::vector<Time> times;
     Array drift;
     Array diffusion;
};

?

Bye,
        Luigi