20 class Collection :
public std::vector<std::shared_ptr<T>>
27 template<
typename... T_>
28 requires ((!std::is_same_v<Collection<T>,T_>) && ...)
29 Collection(
const T_&... x)
34 template<
typename... T_>
35 requires (std::is_same_v<std::shared_ptr<T>,std::shared_ptr<T_>> && ...)
36 Collection(
const std::shared_ptr<T_>&... x)
37 : std::vector<std::shared_ptr<T>>({x...})
40 Collection(
const Collection<T>& c)
41 : std::vector<std::shared_ptr<T>>(c.size())
43 for(
size_t i = 0 ; i < c.size() ; i++)
44 (*this)[i] = std::dynamic_pointer_cast<T>(c[i]->copy());
48 requires std::is_base_of_v<T,T_>
49 void push_back(
const T_& x)
51 this->push_back(std::make_shared<T_>(x));
55 requires std::is_base_of_v<T,T_>
56 void push_back(
const std::shared_ptr<T_>& x)
58 this->std::vector<std::shared_ptr<T>>::push_back(x);
Definition codac2_OctaSym.h:21