Merge pull request #26220 from 78andyp/blurayfixes
[xbmc.git] / xbmc / utils / Random.h
blobac2a0739801159eaab2e3ce133ef98387d982f7d
1 /*
2 * Copyright (C) 2005-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
9 #pragma once
11 #include <algorithm>
12 #include <random>
14 namespace KODI
16 namespace UTILS
18 template<class TIterator>
19 void RandomShuffle(TIterator begin, TIterator end)
21 std::random_device rd;
22 std::mt19937 mt(rd());
23 std::shuffle(begin, end, mt);