Eliminate dependency on Boost.Random
Also replace use of std::random_shuffle (removed in C++17)
with std::shuffle.
Change-Id: I200a8a404e67447c547c9abfa1a5a55a18de9ef3
diff --git a/tests/other/skiplist-prev.hpp b/tests/other/skiplist-prev.hpp
index 1bb416d..c19ca29 100644
--- a/tests/other/skiplist-prev.hpp
+++ b/tests/other/skiplist-prev.hpp
@@ -1,27 +1,29 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
-* Copyright (c) 2014, Regents of the University of California.
-*
-* This file is part of NDN repo-ng (Next generation of NDN repository).
-* See AUTHORS.md for complete list of repo-ng authors and contributors.
-*
-* repo-ng is free software: you can redistribute it and/or modify it under the terms
-* of the GNU General Public License as published by the Free Software Foundation,
-* either version 3 of the License, or (at your option) any later version.
-*
-* repo-ng is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
-* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-* PURPOSE. See the GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License along with
-* repo-ng, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
-*/
+/*
+ * Copyright (c) 2014-2017, Regents of the University of California.
+ *
+ * This file is part of NDN repo-ng (Next generation of NDN repository).
+ * See AUTHORS.md for complete list of repo-ng authors and contributors.
+ *
+ * repo-ng is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation,
+ * either version 3 of the License, or (at your option) any later version.
+ *
+ * repo-ng is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * repo-ng, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
+ */
#ifndef REPO_TESTS_OTHER_SKIPLIST_PREV_HPP
#define REPO_TESTS_OTHER_SKIPLIST_PREV_HPP
#include "common.hpp"
+#include <random>
+
namespace prev {
class SkipList32Levels25Probabilty
@@ -312,8 +314,8 @@
size_t
pickRandomLevel() const
{
- static boost::random::mt19937 gen;
- static boost::random::geometric_distribution<size_t> dist(Traits::getProbability());
+ static std::mt19937 gen(std::random_device{}());
+ static std::geometric_distribution<size_t> dist(Traits::getProbability());
return std::min(dist(gen), Traits::getMaxLevels());
}