mcpp index

compat.boost-config

#include

Boost.Config 1.92.0 — platform/compiler/stdlib detection macros; root of the modular-boost header family

#include <boost/version.hpp>
mcpp add compat.boost-config@1.92.0

用法

來自本倉庫自己的測試專案 —— CI 真的編譯並執行過,不是為了網站寫的。

// Behavioral test: the compat.boost-config headers are present and identify
// themselves as exactly the pinned 1.92.0 train. If the descriptor ever
// drifts to another release without this member following, this fails loudly.
#include <boost/version.hpp>
#include <boost/config.hpp>
#include <string_view>

int main() {
    // BOOST_VERSION encodes major*100000 + minor*100 + patch -> 1.92.0.
    bool ok = BOOST_VERSION == 109200;
    ok = ok && std::string_view(BOOST_LIB_VERSION) == "1_92";

    // Platform detection must have positively selected THIS platform's header:
    // each platform/*.hpp stamps BOOST_PLATFORM with its own string. A config
    // that silently defaulted everywhere would fail on every branch.
#if defined(_WIN32)
    ok = ok && std::string_view(BOOST_PLATFORM) == "Win32";
#elif defined(__APPLE__) && defined(__MACH__)
    ok = ok && std::string_view(BOOST_PLATFORM) == "Mac OS";
#elif defined(__linux__)
    ok = ok && std::string_view(BOOST_PLATFORM) == "linux";
#else
// …

tests/examples/boost-config/tests/config.cpp · 專案 tests/examples/boost-config

建置

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

原始檔 (1)

  • mcpp_generated/boost_config_anchor.cpp

產生的檔案

  • mcpp_generated/boost_config_anchor.cpp

版本

版本平台 鏡像sha256
1.92.0 最新 LinuxWindowsmacOS 來源 b4171037f133…