• =?UTF-8?Q?=22C++20_Modules_=e2=80=94_Complete_Guide=22_by_=c5=a0imo?= =

    From Lynn McGuire@21:1/5 to All on Mon Sep 13 17:33:03 2021
    "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."

    Lynn

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Tim Woodall@21:1/5 to Lynn McGuire on Tue Sep 14 07:49:46 2021
    On 2021-09-13, Lynn McGuire <lynnmcguire5@gmail.com> 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 <iostream>;

    Is the semicolon required here? Subtle, hard to spot change if it is!


    This statement:

    Unexported symbols have private visibility, which is the opposite of
    normal C++ behaviour, where only symbols within anonymous namespaces are unexported.


    Has the export of symbols in anonymous namespaces changed? One upon a
    time symbols in the anonymous namespaces were exported, but with a
    mangled name that couldn't be deduced elsewhere.


    I like the "cleanness" of anonymous namespaces over static. But I've
    seen places where the sheer volume of exported but unused by the linker
    symbols causes problems, especially for tools that, for example, attempt
    to check for circular dependencies being introduced.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Anand Hariharan@21:1/5 to Tim Woodall on Tue Sep 14 07:22:47 2021
    On Tuesday, September 14, 2021 at 2:50:20 AM UTC-5, Tim Woodall wrote:
    On 2021-09-13, Lynn McGuire <lynnmc...@gmail.com> 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 <iostream>;

    Is the semicolon required here? Subtle, hard to spot change if it is!


    The code in the page was

    import <iostream>;

    Code uses 'import' not 'include'; also the '#' is omitted. In other words, no preprocessor at play.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Keith Thompson@21:1/5 to Anand Hariharan on Tue Sep 14 09:55:36 2021
    Anand Hariharan <mailto.anand.hariharan@gmail.com> writes:
    On Tuesday, September 14, 2021 at 2:50:20 AM UTC-5, Tim Woodall wrote:
    On 2021-09-13, Lynn McGuire <lynnmc...@gmail.com> 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 <iostream>;

    Is the semicolon required here? Subtle, hard to spot change if it is!


    The code in the page was

    import <iostream>;

    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 */

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)