mcpp index

compat.etl

#include

Embedded Template Library — fixed-capacity containers and utilities (header-only)

#include <etl/queue.h>
mcpp add compat.etl@20.49.0

用法

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

// compat.etl — exercise ETL's fixed-capacity containers and their observable
// capacity/ordering behaviour.
#include <etl/queue.h>
#include <etl/vector.h>

int main() {
    etl::vector<int, 4> values;
    values.push_back(3);
    values.push_back(1);
    values.push_back(4);

    if (values.size() != 3 || values.capacity() != 4 ||
        values[0] != 3 || values[2] != 4) {
        return 1;
    }

    etl::queue<int, 4> queue;
    queue.push(10);
    queue.push(20);
    if (queue.front() != 10 || queue.back() != 20) {
        return 2;
    }
// …

tests/examples/etl/tests/containers.cpp · 项目 tests/examples/etl

构建

targets
etl (lib)
language
c++23
C standard
c11
import std
no
include dirs
*/include

源文件 (1)

  • mcpp_generated/etl_anchor.c

生成的文件

  • mcpp_generated/etl_anchor.c

版本

版本平台 镜像sha256
20.49.0 最新 LinuxWindowsmacOS 源站 b3e7a5544795…