Remove a lot of boost dependencies and workarounds.

This commit is contained in:
jzmaddock
2020-12-01 18:57:42 +00:00
parent 678b3f5c4d
commit 957dc5b79c
48 changed files with 600 additions and 697 deletions

View File

@ -15,7 +15,14 @@
* VERSION see <boost/version.hpp>
* DESCRIPTION: Test code for a generic object cache.
*/
#include <boost/regex/pending/object_cache.hpp>
#include <boost/regex/config.hpp>
#ifdef BOOST_REGEX_CXX03
#include <boost/regex/v4/object_cache.hpp>
#define SP_NS boost
#else
#include <boost/regex/v5/object_cache.hpp>
#define SP_NS std
#endif
#include <boost/detail/lightweight_main.hpp>
#include "../test_macros.hpp"
@ -49,7 +56,7 @@ int cpp_main(int /*argc*/, char * /*argv*/[])
int i;
for(i = 0; i < 20; ++i)
{
boost::shared_ptr<const test_object> p = boost::object_cache<int, test_object>::get(i, max_cache_size);
SP_NS::shared_ptr<const test_object> p = boost::object_cache<int, test_object>::get(i, max_cache_size);
BOOST_CHECK(p->value() == i);
p = boost::object_cache<int, test_object>::get(i, max_cache_size);
BOOST_CHECK(p->value() == i);
@ -64,7 +71,7 @@ int cpp_main(int /*argc*/, char * /*argv*/[])
{
for(i = 20 - max_cache_size; i < 20; ++i)
{
boost::shared_ptr<const test_object> p = boost::object_cache<int, test_object>::get(i, max_cache_size);
SP_NS::shared_ptr<const test_object> p = boost::object_cache<int, test_object>::get(i, max_cache_size);
BOOST_CHECK(p->value() == i);
p = boost::object_cache<int, test_object>::get(i, max_cache_size);
BOOST_CHECK(p->value() == i);