35 using container_type = std::vector<std::shared_ptr<Constraint>>;
39 using iterator =
typename container_type::iterator;
43 void reset_forces()
const {
44 for (
auto const &constraint : *
this) {
45 constraint->reset_force();
49 container_type m_constraints;
52 bool contains(std::shared_ptr<Constraint>
const &constraint)
const noexcept {
53 return std::find(begin(), end(), constraint) != end();
55 void add(std::shared_ptr<Constraint>
const &constraint);
56 void remove(std::shared_ptr<Constraint>
const &constraint);
69 if (not m_constraints.empty()) {
70 throw std::runtime_error(
"The box size can not be changed because there "
71 "are active constraints.");