mcpp index

compat.boost-throw-exception

#include

Boost.ThrowException 1.92.0 — common exception-raising infrastructure for Boost libraries

#include <boost/throw_exception.hpp>
mcpp add compat.boost-throw-exception@1.92.0

用法

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

// Behavioral test: BOOST_THROW_EXCEPTION raises an exception catchable as its
// own std::exception base, carrying the original message through what().
#include <boost/throw_exception.hpp>
#include <stdexcept>
#include <cstring>

int main() {
    bool caught = false;
    try {
        BOOST_THROW_EXCEPTION(std::runtime_error("compat probe"));
    } catch (const std::exception& e) {
        caught = std::strstr(e.what(), "compat probe") != nullptr;
    }
    return caught ? 0 : 1;
}

tests/examples/boost-throw-exception/tests/throw_exception.cpp · 项目 tests/examples/boost-throw-exception

构建

targets
boost_throw_exception (lib)
language
c++20
import std
no
include dirs
*/include

源文件 (1)

  • mcpp_generated/boost_throw_exception_anchor.cpp

生成的文件

  • mcpp_generated/boost_throw_exception_anchor.cpp

版本

版本平台 镜像sha256
1.92.0 最新 LinuxWindowsmacOS 源站 1ddbb967a435…