When creating a CostStack, the user must keep in mind the index of each Cost component they have defined, in order to be able to modify the Cost object later on. It would be more intuitive to use std::map<String,CostPtr> to retrieve each component, instead of using std::vector<CostPtr>.