C++ Module Interface
A console application that uses a single module interface file used inside the same projects.
recipe.sml
The Recipe file that sets the name, type, version, the public interface module and the single source file.
Name: 'Samples.Cpp.ModuleInterface'
Language: 'C++|0'
Type: 'Executable'
Version: 1.0.0
package-lock.sml
The package lock that was generated to capture the unique build dependencies required to build this project.
helper.cpp
A module interface file that exports a single sample class.
module;
// Include all standard library headers in the global module
#include <string>
export module Samples.Cpp.ModuleInterface;
export class Helper
{
public:
static std::string GetName()
{
return "Soup";
}
};
main.cpp
A simple main method that prints our "Hello World, Soup Style!" by using the module from the previous file.
#include <iostream>
import Samples.Cpp.ModuleInterface;
int main()
{
std::cout << "Hello World, " << Helper::GetName() << " Style!" << std::endl;
return 0;
}
.gitignore
A simple git ignore file to exclude all Soup build output.