Path: csiph.com!news.mixmin.net!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c++ Subject: Re: "C++20 Modules ??? Complete Guide" by ??imon T??th Date: Tue, 14 Sep 2021 09:55:36 -0700 Organization: None to speak of Lines: 51 Message-ID: <8735q7drlj.fsf@nosuchdomain.example.com> References: <117fe0fd-ffcf-4953-921c-4f3b245aa112n@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: reader02.eternal-september.org; posting-host="e43aa629221922c685a4d1b5cdadf7b9"; logging-data="10144"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18LX2av7Vkvn5m7NMz0nqbV" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) Cancel-Lock: sha1:OTnHyTxDrjmy1azKkXZteFwf4pc= sha1:ClYCQOZmPYa+z5XUNM7PwQZ4DDY= Xref: csiph.com comp.lang.c++:81266 Anand Hariharan writes: > On Tuesday, September 14, 2021 at 2:50:20 AM UTC-5, Tim Woodall wrote: >> On 2021-09-13, Lynn McGuire wrote: >> > "C++20 Modules ??? Complete Guide" by ??imon T??th >> > https://itnext.io/c-20-modules-complete-guide-ae741ddbae3d >> > >> > "Compilers and build systems are slowly starting to support C++20 >> > modules. Perfect time for you to read this guide and benefit from the >> > massive compilation speedups. This article reflects the state as of >> > September 2021." >> > >> Thanks for the link. >> >> I have a couple of quick questions. >> >> In the "module" example we have >> #include ; >> >> Is the semicolon required here? Subtle, hard to spot change if it is! >> > > The code in the page was > > import ; > > Code uses 'import' not 'include'; also the '#' is omitted. In other words, no preprocessor at play. And to answer the question, yes, the semicolon is required. From the N4885 draft: module-declaration : export-keyword[opt] module-keyword module-name module-partition[opt] attribute-specifier-seq[opt] ; module-name : module-name-qualifier[opt] identifier module-partition : : module-name-qualifier[opt] identifier module-name-qualifier : identifier . module-name-qualifier identifier . ("module-keyword" is "module". The "module", "import", and "export" keywords are treated specially.) -- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com Working, but not speaking, for Philips void Void(void) { Void(); } /* The recursive call of the void */