Look up the global constructor list that the linker outputs, and run them all. Required creation of the `kutil::no_construct` template for objects that are constructed before the global constructors are run. Also split the `memory_initialize` function into two - one for just those objects that need to happen before the global ctors, and one after. Tags: memory c++
16 lines
283 B
C++
16 lines
283 B
C++
#pragma once
|
|
/// \file no_construct.h
|
|
/// Tools for creating objects witout running constructors
|
|
|
|
namespace kutil {
|
|
|
|
/// Helper template for creating objects witout running constructors
|
|
template <typename T>
|
|
union no_construct
|
|
{
|
|
T value;
|
|
no_construct() {}
|
|
};
|
|
|
|
} // namespace kutil
|