Мне интересно, возможно ли иметь оператора в неэлементном родительском классе с авто возвращающимся значением и шаблоном дочернего класса?[code]#include #include class parent{ public: virtual ~parent(){}; auto & operator()(const int i); }; template class child:public parent{ protected: std::vector X_; public: child(std::vector const &X):X_{X}{}; T & operator()(const int i){ return(X_[i]); } }; auto & parent::operator()(const int i){ if(auto * x=dynamic_cast(this)){ return((*x)(i)); }else if(auto * x=dynamic_cast(this)){ return((*x)(i)); }else{ throw std::string("error"); } }; int main(){ child Y1(std::vector{5,10}); child Y2(std::vector{6,11}); std::cout