mirror of
https://github.com/USCiLab/cereal.git
synced 2025-10-18 01:45:52 +02:00
g++ 4.7.3 compatability fixed
closes #38 Added a preprocessor define CEREAL_OLDER_GCC that exists if using any GCC 4.7.x or earlier. If this is defined some type traits change to our original solution (prior to VS compatible), which is probably what we'd switch to if VS ever gets around to fully supporting SFINAE and constexpr. In map and set, as well as in unit tests, use insert instead of emplace for 4.7.x.
This commit is contained in:
@@ -811,8 +811,13 @@ void test_map_memory()
|
||||
|
||||
for(int j=0; j<100; ++j)
|
||||
{
|
||||
#ifdef CEREAL_OLDER_GCC
|
||||
o_uniqueptrMap.insert( std::make_pair(random_value<int>(gen), std::unique_ptr<int>( new int( random_value<int>(gen) ) )) );
|
||||
o_sharedptrMap.insert( std::make_pair(random_value<int>(gen), std::make_shared<int>( random_value<int>(gen) )) );
|
||||
#else // NOT CEREAL_OLDER_GCC
|
||||
o_uniqueptrMap.emplace( random_value<int>(gen), std::unique_ptr<int>( new int( random_value<int>(gen) ) ) );
|
||||
o_sharedptrMap.emplace( random_value<int>(gen), std::make_shared<int>( random_value<int>(gen) ) );
|
||||
#endif // NOT CEREAL_OLDER_GCC
|
||||
}
|
||||
|
||||
std::ostringstream os;
|
||||
|
||||
Reference in New Issue
Block a user