SkillAgentSearch skills...

Stdmodules

A toy example to explore the possible implementation for std modules

Install / Use

/learn @ChuanqiXu9/Stdmodules
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

This is a toy example to explore possible methods to implement std modules.

It requries clang compiler and libcxx in 15.x branch.

Tested with libstdc++ 10.3.

Most of the examples are extracted from cppreference.

How to run with libstdc++

# Set clang15.x as the default clang compiler
# Set STL_PATH in Makefile to the desired path
make && cd examples && make
# Remove all the `-lc++` in exmaples/*/Makefiles
Run the examples you want

How to run with libc++

# Set clang15.x as the default clang compiler
# Set the path to libc++ in Makefile
make && cd examples && make
Run the examples you want

Known Problems

User Defined Deduction Guide

Currently, Clang doesn't take care of User Defined Deduction Guide in C++20 Modules. So now we need to write:

std::lock_guard<std::mutex> lk(mutex);

instead of

std::lock_guard lk(mutex);
Non Inline constexpr variables

See functional.cppm for example. The standard forbids us to export using const things unless they are inlined. The libcxx implements them as non-inline constexpr variables. So we make another trick to rename these constexpr variables.

Related Skills

View on GitHub
GitHub Stars13
CategoryDevelopment
Updated4mo ago
Forks2

Languages

Makefile

Security Score

72/100

Audited on Dec 3, 2025

No findings