I cannot understand what is going on here with `static T & instance;`, I propose to do not change `create()`. But it would be better if someone explain what is happening here :)
Instead of using a multimap, we really just want the shortest path found per iteration.
Went back to a map, if a shorter path is found before we commit the changes, stage the shorter one instead.
Fixed crash CEREAL_THREAD_SAFE=1 with polymorphic class. Crash happened because StaticObject<T>::instanceMutex not initialized when StaticObject<T>::lock() called for the first time. Basically it is better to use static vars inside static functions to have predefined order of construction like it is done in StaticObject<T>::getInstance(), which calls create and forces instantiation at pre-execution time.
Also in this commit removed static T &instance; since it is possible that there were be two instances created
1) template <class T> T & StaticObject<T>::instance = StaticObject<T>::create();
2) inside StaticObject<T>::create()
Fix for #341, #273, and #104. Replace usages of "check(" with
"(check)(", which will prevent us from colliding with the macro defined
in OSX's Assert macros.
-Make CEREAL_THREAD_SAFE be 0 or 1 instead of present or not present
-Move CEREAL_NOEXCEPT to macros.hpp
-instead of individual locks, can now use StaticObject::lock() to request a lock if CEREAL_THREAD_SAFE is enabled. If
not enabled, this call returns an empty object. The lock returned acts just like std::lock_guard, but uses
std::unique_lock internally
-Made a bunch of requests to StaticObject::getInstance const
-Added first stab at multithreaded tests with versioning and polymorphism
Resolves#283
Previously EnableSharedStateHelper restored the internal weak_ptr for
enable_shared_from_this after load_and_construct was called, it is now
called as soon as construct() is called, allowing a user to use shared_from_this
to initialize various member variables. See issue for more info.
relates to #281
Now if someone has a hierarchy like A -> B -> C,
the A->C relation will be automatically created if A->B and B->C already exist.
This is implemented by a chain of casts to get down the inheritance.
In the case of multiple paths, the shortest one will be chosen.
Updated and made changes necessary for the new version of rapidjson.
Looks good on ubuntu under the compilers I can test with, needs MSVC testing.
We had some internal changes to rapidjson but these didn't seem necessary with
the new version. Haven't done any performance testing, initial estimates put it at
nearly the same speed for json serialization. Could probably optimize things.
relates #82, #121