#include <thread>
#include <boost/iterator/iterator_facade.hpp>
#include <boost/scoped_ptr.hpp>
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <glog/logging.h>
#include "folly/ConcurrentSkipList-inl.h"
}
// create a shared_ptr skiplist object with initial head height.
- static boost::shared_ptr<SkipListType> createInstance(int height=1) {
- return boost::shared_ptr<SkipListType>(new SkipListType(height));
+ static std::shared_ptr<SkipListType> createInstance(int height=1) {
+ return std::shared_ptr<SkipListType>(new SkipListType(height));
}
// create a unique_ptr skiplist object with initial head height.
typedef typename SkipListType::const_iterator const_iterator;
typedef typename SkipListType::Skipper Skipper;
- explicit Accessor(boost::shared_ptr<ConcurrentSkipList> skip_list)
+ explicit Accessor(std::shared_ptr<ConcurrentSkipList> skip_list)
: slHolder_(std::move(skip_list))
{
sl_ = slHolder_.get();
private:
SkipListType *sl_;
- boost::shared_ptr<SkipListType> slHolder_;
+ std::shared_ptr<SkipListType> slHolder_;
};
// implements forward iterator concept.
typedef T* pointer;
typedef ptrdiff_t difference_type;
- Skipper(const boost::shared_ptr<SkipListType>& skipList) :
+ Skipper(const std::shared_ptr<SkipListType>& skipList) :
accessor_(skipList) {
init();
}
#include <set>
#include <thread>
-#include <boost/shared_ptr.hpp>
-
#include <gflags/gflags.h>
#include <glog/logging.h>
#include "folly/Benchmark.h"
std::vector<ValueType> deleteValues_;
};
-static std::map<int, boost::shared_ptr<ConcurrentAccessData> > g_data;
+static std::map<int, std::shared_ptr<ConcurrentAccessData> > g_data;
static ConcurrentAccessData *mayInitTestData(int size) {
auto it = g_data.find(size);
if (it == g_data.end()) {
- auto ptr = boost::shared_ptr<ConcurrentAccessData>(
+ auto ptr = std::shared_ptr<ConcurrentAccessData>(
new ConcurrentAccessData(size));
g_data[size] = ptr;
return ptr.get();
TEST(ConcurrentSkipList, TestStringType) {
typedef folly::ConcurrentSkipList<std::string> SkipListT;
- boost::shared_ptr<SkipListT> skip = SkipListT::createInstance();
+ std::shared_ptr<SkipListT> skip = SkipListT::createInstance();
SkipListT::Accessor accessor(skip);
{
for (int i = 0; i < 100000; i++) {