...

/

A First Example

A First Example

Learn what a basic module looks like in C++20.

We'll cover the following...

The purpose of this section is straightforward: I will give you an introduction to modules. More advanced features of modules are in the following sections. Let’s start with a simple math module, written in the math.ixx file.

Press + to interact
// math.ixx
export module math;
export int add(int fir, int sec){
return fir + sec;
}

The expression export module math is the module declaration. By putting export before function add ...