From ee88fbafd6bbabb010fea96cf73f202e659ae45a Mon Sep 17 00:00:00 2001 From: Yegor Bychin <48245894+sigasigasiga@users.noreply.github.com> Date: Wed, 29 Sep 2021 00:29:07 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BD=D0=B5=20=D0=BA=D0=BE=D0=BC=D0=BF=D0=B8?= =?UTF-8?q?=D0=BB=D0=B8=D1=80=D1=83=D0=B5=D1=82=D1=81=D1=8F=20=D0=BF=D1=80?= =?UTF-8?q?=D0=B8=D0=BC=D0=B5=D1=80=20=D0=BA=D0=BE=D0=B4=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit из дочернего класса нельзя просто так достучаться до методов родительского, если родительский класс параметризован шаблоном. только через `this->` --- lifetime/decltype_auto_and_explicit_types.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lifetime/decltype_auto_and_explicit_types.md b/lifetime/decltype_auto_and_explicit_types.md index 1ff18d4..85abbde 100644 --- a/lifetime/decltype_auto_and_explicit_types.md +++ b/lifetime/decltype_auto_and_explicit_types.md @@ -62,8 +62,8 @@ class MapWrapper : private std::map { public: template const std::pair& find_if_or_throw(Predicate p) const { - auto item = std::find_if(cbegin(), cend(), p); - if (item == cend()) { + auto item = std::find_if(this->cbegin(), this->cend(), p); + if (item == this->cend()) { throw std::runtime_error("not found"); } return *item;