Skip to content

mcpplibs/templates

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mcpplibs templates

mcpplibs templates...

src/templates.cppm

module; // 0 - global module declaration

// 1 - include & macro area
// #include <stdio.h>

// 2 - module declaration
export module mcpplibs.templates;

// 3 - import area
import std;

// 4 - module implementation partition
namespace mcpplibs {

    // 5 - exported entities
    export void hello_mcpp() {
        std::println("hello mcpp!");
    }

}  // namespace mcpplibs

tests/main.cpp

// 6 - import module
import mcpplibs.templates;

auto main() -> int {
    // 7 - call exported function
    mcpplibs::hello_mcpp();
}

Install & Config

xlings install

Build & Run

Using xmake

xmake build
xmake r

Using CMake

cmake -B build -G Ninja
cmake --build build
./build/tests

Other