mcpp index

yizhinailong.mcr

import

Modular C++23 HTTP client on libcurl — sync, async, coroutine and batch requests with typed responses

import mcr;

模块名读自上游 src/mcr.cppm 里的 `export module` 声明。

mcpp add yizhinailong.mcr@0.1.5

用法

来自本仓库自己的测试项目 —— CI 真的编译并运行过,不是为了网站写的。

// yizhinailong.mcr — prove the public module surface compiles, links and
// behaves. A live HTTP round trip is deliberately out of scope: it would need
// a local server plus the curl runtime, neither of which belongs in an index
// member. What is exercised here is everything that is observable offline —
// the generated version module, the status classifiers, the owned option
// types, and the Response JSON parsing path.

import std;
import mcr;

#ifndef MCR_EXPECT_VERSION
#define MCR_EXPECT_VERSION "0.1.5"
#define MCR_EXPECT_MAJOR 0
#define MCR_EXPECT_MINOR 1
#define MCR_EXPECT_PATCH 5
#endif

int main() {
    // mcr.version is generated by the package's own build.mcpp, read out of
    // its mcpp.toml. Asserting on it proves the build hook ran and the
    // generated module unit reached the library target.
    if (mcr::VERSION != MCR_EXPECT_VERSION) return 1;
// …

tests/examples/mcr/tests/api.cpp · 项目 tests/examples/mcr

构建 · 上游清单

modules
mcr
targets
mcr (lib)
manifest version
0.1.5
dependencies
compat, nlohmann
来源
https://raw.githubusercontent.com/yizhinailong/mcr/v0.1.5/mcpp.toml

版本

版本平台 镜像sha256
0.1.5 最新 LinuxWindowsmacOS 源站 bd55e9dc19b6…