mcpp index

compat.boost-any

#include

Boost.Any 1.92.0 — a type-safe container for single values of different types

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

Usage

From this repository's own test project — built and run by CI, not written for the website.

#include <boost/any.hpp>

#include <string>

int main() {
    boost::any value = 42;
    if (value.empty()) return 1;
    if (boost::any_cast<int>(value) != 42) return 1;

    value = std::string("muduo");
    const auto* text = boost::any_cast<std::string>(&value);
    if (text == nullptr || *text != "muduo") return 1;

    value.clear();
    return value.empty() ? 0 : 1;
}

tests/examples/boost-any/tests/any.cpp · project tests/examples/boost-any

Build

targets
boost_any (lib)
language
c++23
import std
no
include dirs
*/include

Sources (1)

  • mcpp_generated/boost_any_anchor.cpp

Generated files

  • mcpp_generated/boost_any_anchor.cpp

Versions

VersionPlatforms Mirrorssha256
1.92.0 latest LinuxWindowsmacOS source 335090455387…