#pragma once #include "links/BaseLink.h" #include template class OneToOneLink : public BaseLink { public: using ElemPtr = std::shared_ptr; OneToOneLink(ElemPtr e) : BaseLink(e) {} void addChild(const ElemPtr& child) override { if (!this->children_.empty()) throw std::logic_error("Too many children"); BaseLink::addChild(child); } };