Open JimViebke opened 8 years ago
class Objectives { private: std::shared_ptr<Objective> objective; std::vector<std::shared_ptr<Objectives>> child_objectives; bool is_leaf_node() const { return child_objectives.size() == 0; } public: std::shared_ptr<Objective> get_leaf_objective() { return (is_leaf_node()) ? objective : child_objectives.back()->get_leaf_objective(); } };