Date: Sat, 15 Aug 2026 13:27:57 +0000
to elaborate more on the issue: previously `using A::get;` alone is enough to
export a member function from a private base. with explicit object parameters,
to export a member function from private base, `using A::get;` isn't enough
anymore, and instead you have to either write a forwarder function matching
the exact signatures for every overload, or write this in the derived class:
```cpp
decltype(auto) get(this auto &&self, auto &&...args)
noexcept(noexcept((std::forward<decltype(self)>(self)).A3::get(std::forward<decltype(args)>(args)...)))
requires (requires {
(std::forward<decltype(self)>(self)).A3::get(std::forward<decltype(args)>(args)...);
})
{
return
(std::forward<decltype(self)>(self)).A3::get(std::forward<decltype(args)>(args)...);
}
```
which adds unnecessary template instantiations and hinders IDE auto-completion
signature hinting, and also hurts readability. `using A::get;` is much
cleaner.
you can use protected members in the base class and use protected inheritance,
however that pollutes the derived class with all the names from the base class
which should have been private.
export a member function from a private base. with explicit object parameters,
to export a member function from private base, `using A::get;` isn't enough
anymore, and instead you have to either write a forwarder function matching
the exact signatures for every overload, or write this in the derived class:
```cpp
decltype(auto) get(this auto &&self, auto &&...args)
noexcept(noexcept((std::forward<decltype(self)>(self)).A3::get(std::forward<decltype(args)>(args)...)))
requires (requires {
(std::forward<decltype(self)>(self)).A3::get(std::forward<decltype(args)>(args)...);
})
{
return
(std::forward<decltype(self)>(self)).A3::get(std::forward<decltype(args)>(args)...);
}
```
which adds unnecessary template instantiations and hinders IDE auto-completion
signature hinting, and also hurts readability. `using A::get;` is much
cleaner.
you can use protected members in the base class and use protected inheritance,
however that pollutes the derived class with all the names from the base class
which should have been private.
Received on 2026-08-15 13:28:10
