C++ Logo

std-discussion

Advanced search

Re: Attaching a declaration

From: Vladimir Grigoriev <vlad.moscow_at_[hidden]>
Date: Thu, 17 Feb 2022 11:09:10 +0300
If the namespace is a part of the global module then what is the meaning to export it in a named module?
 
 
You can meet me at http://cpp.forum24.ru/ or www.stackoverflow.com or http://ru.stackoverflow.com
 
  
>Четверг, 17 февраля 2022, 1:34 +03:00 от Jason McKesson via Std-Discussion <std-discussion_at_[hidden]>:
>
>On Wed, Feb 16, 2022 at 2:43 PM Vladimir Grigoriev via Std-Discussion
>< std-discussion_at_[hidden] > wrote:
>>
>> The p. # 7 in the section «10.1 Module units and purviews» says if it
>> (7.1.2) — is a namespace-definition with external linkage,
>> it is attached to the global module.
>>
>> So if you have
>>
>> export module A;
>> namespace N1
>> {
>> int x;
>> }
>>
>> or
>>
>> export module A;
>> export namespace N1
>> {
>> int x;
>> }
>>
>> when is the namespace definition N1 attached to the global module (because it has external linkage) or to the purview of the module A?
>Namespaces have external linkage if they are not unnamed or are not in
>an unnamed namespace. All such namespaces are therefore part of the
>global module.
>
>I don't see what is confusing here.
>--
>Std-Discussion mailing list
>Std-Discussion_at_[hidden]p.org
>https://lists.isocpp.org/mailman/listinfo.cgi/std-discussion
 

Received on 2022-02-17 08:09:27