C++20 brought us a modules, and while compilers support of this language feature is weak, some already provide at least partial support.
VS2019 claim that has experimental support of modules. But how make it works?
From microft's docs [Overview of modules in C++](https://docs.microsoft.com/en-us/cpp/cpp/modules-cpp?view=vs-2019) I know that I need file with .ixx extension, let's call it Foo.ixx:
export module Foo;
export int f()
std::cout << "The result of f() is " << Foo::f() << '\n';
How can I build this example from Visual Studio 2019 Developer Command Prompt?
As described [here](https://devblogs.microsoft.com/cppblog/c-modules-conformance-improvements-with-msvc-in-visual-studio-2019-16-5/), you need to compile with two options:
cl /experimental:module /std:c++latest /c Foo.ixx
cl /experimental:module /std:c++latest test.cpp Foo.obj
Note that for `import std.core;` to work you need to have the library part of the C++ modules feature installed (via VS setup)
Also note that the VS gui doesn't properly seem to recognize the `.ixx` extention. You at least need to set the `item type` to `C/C++ compiler` under configuration properties.