OS Manuals

static_object.hpp(3)

static_object.hpp - Internal polymorphism static object support.

static_object.hpp(3) Library Functions Manual static_object.hpp(3)

static_object.hpp - Internal polymorphism static object support.

#include 'cereal/macros.hpp'


class cereal::detail::StaticObject< T >
A static, pre-execution object. class cereal::detail::StaticObject< T >::LockGuard
A class that acts like std::lock_guard.


#define CEREAL_DLL_EXPORT __attribute__ ((visibility('default')))
Prevent link optimization from removing non-referenced static objects. #define CEREAL_USED __attribute__ ((__used__))


template<class T> T & cereal::detail::StaticObject< T >::instance = StaticObject<T>::create()

Internal polymorphism static object support.

Prevent link optimization from removing non-referenced static objects. Especially for polymorphic support, we create static objects which may not ever be explicitly referenced. Most linkers will detect this and remove the code causing various unpleasant runtime errors. These macros, adopted from Boost (see force_include.hpp) prevent this (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . Use, modification and distribution is subject to the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Generated automatically by Doxygen for cereal from the source code.

Sat Aug 29 2026 00:42:30 cereal

cereal 1.3.2-r5 · enterprise-packages · ingested 2026-10-02