mcpp index

compat.boost-type-traits

#include

Boost.TypeTraits 1.92.0 — compile-time type introspection traits

#include <boost/type_traits/is_same.hpp>
mcpp add compat.boost-type-traits@1.92.0

Usage

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

// Behavioral test: core traits give the right answers, cross-checked against
// the standard library where an equivalent exists.
#include <boost/type_traits/is_same.hpp>
#include <boost/type_traits/add_pointer.hpp>
#include <boost/type_traits/remove_cv.hpp>
#include <type_traits>

int main() {
    static_assert(boost::is_same<int, int>::value, "same type must match");
    static_assert(!boost::is_same<int, long>::value, "distinct types must differ");
    static_assert(std::is_same<boost::add_pointer<int>::type, int*>::value,
                  "add_pointer must yield int*");
    static_assert(std::is_same<boost::remove_cv<const volatile int>::type, int>::value,
                  "remove_cv must strip const/volatile");

    bool ok = boost::is_same<double, double>::value;   // runtime-visible path
    return ok ? 0 : 1;
}

tests/examples/boost-type-traits/tests/type_traits.cpp · project tests/examples/boost-type-traits

Build

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

Sources (1)

  • mcpp_generated/boost_type_traits_anchor.cpp

Generated files

  • mcpp_generated/boost_type_traits_anchor.cpp

Versions

VersionPlatforms Mirrorssha256
1.92.0 latest LinuxWindowsmacOS source ee6c4d3d993f…