C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Allowing `using namespace` in class definition

From: Andrey Semashev <andrey.semashev_at_[hidden]>
Date: Mon, 13 Mar 2023 18:47:05 +0300
On 3/13/23 18:14, Thiago Macieira via Std-Proposals wrote:
> On Monday, 13 March 2023 05:00:13 PDT Andrey Semashev via Std-Proposals wrote:
>> It would seem not fundamentally different from other
>> contexts, like within a function body
>
> Because they are fundamentally different.

Could you clarify in what way?

> Anyway, would this apply to the member functions in this class?
>
> Would it apply to derived classes too? And their member functions?

As using directive affects name lookup then yes, to all of those. You
import names into the class scope, and those names become available
unqualified in all member function and derived class scopes. This works
the same way when importing names into namespaces or function scopes.

Received on 2023-03-13 15:47:23