compat.boost-throw-exception
#includeBoost.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… |