Stdmodules
A toy example to explore the possible implementation for std modules
Install / Use
/learn @ChuanqiXu9/StdmodulesREADME
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
node-connect
349.9kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
109.8kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
349.9kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
349.9kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
