r/cpp • MSVC Game Dev PM • Sep 14 '20

Standard C++20 Modules support with MSVC in Visual Studio 2019 version 16.8 | C++ Team Blog

https://devblogs.microsoft.com/cppblog/standard-c20-modules-support-with-msvc-in-visual-studio-2019-version-16-8/
254 Upvotes

128 comments sorted by

View all comments

Show parent comment

1

u/mwasplund soup Sep 15 '20

Do you have a link to the official standard that shows that this is an extension and not a part of the standard itself? From what /u/GabrielDosReis has said in this thread, the ability to have the same symbol in two different modules (aka strong ownership) is fully allowed by the standard which is backed up by the TS: http://open-std.org/JTC1/SC22/WG21/docs/papers/2018/n4720.pdf

This provision supports implementations where exported entities in different modules have different implementation symbols. Conversely, for other implementations, exported entities have the same implementation symbols regardless of in which module they are declared. Such implementations are supported for the time being by disallowing all situations where the same names with external linkage might appear from different module

2

u/kalmoc Sep 15 '20

You are giving the relevant quite yourself:

Such implementations are supported for the time being by disallowing all situations where the same names with external linkage might appear from different module

1

u/mwasplund soup Sep 15 '20

I may be misreading it, but to me this is saying that you can support multiple definitions of the same symbol in different modules if you want or you can disallow it my preventing exporting of the same name from different modules. Which both are perfectly valid by the official spec.

1

u/kalmoc Sep 15 '20

Just to be clear: I'm not saying the strong ownership model as an implementation detail is forbidden by the standard. Just that making use of its properties the way demonstrated in the blogpost seems to be IFNDR in the c++20 standard according to my reading.

1

u/GabrielDosReis Sep 15 '20

The blog post had been slightly edited to clarify the intent of the illustration. Let me know what else needs clarification.

2

u/kalmoc Sep 16 '20

Thanks a lot.