Evgeniy Stepanov | 732e268 | 2015-05-13 16:55:41 +0000 | [diff] [blame] | 1 | // -*- C++ -*- |
| 2 | //===-------------------------- algorithm ---------------------------------===// |
| 3 | // |
| 4 | // The LLVM Compiler Infrastructure |
| 5 | // |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open |
| 7 | // Source Licenses. See LICENSE.TXT for details. |
| 8 | // |
| 9 | //===----------------------------------------------------------------------===// |
| 10 | |
| 11 | #ifndef _LIBCPP_EXPERIMENTAL_ALGORITHM |
| 12 | #define _LIBCPP_EXPERIMENTAL_ALGORITHM |
| 13 | |
| 14 | /* |
| 15 | experimental/algorithm synopsis |
| 16 | |
| 17 | #include <algorithm> |
| 18 | |
| 19 | namespace std { |
| 20 | namespace experimental { |
| 21 | inline namespace fundamentals_v1 { |
| 22 | |
| 23 | template <class ForwardIterator, class Searcher> |
| 24 | ForwardIterator search(ForwardIterator first, ForwardIterator last, |
| 25 | const Searcher &searcher); |
| 26 | template <class PopulationIterator, class SampleIterator, class Distance, |
| 27 | class UniformRandomNumberGenerator> |
| 28 | SampleIterator sample(PopulationIterator first, PopulationIterator last, |
| 29 | SampleIterator out, Distance n, |
| 30 | UniformRandomNumberGenerator &&g); |
| 31 | |
| 32 | } // namespace fundamentals_v1 |
| 33 | } // namespace experimental |
| 34 | } // namespace std |
| 35 | |
| 36 | */ |
| 37 | |
| 38 | #include <experimental/__config> |
| 39 | #include <algorithm> |
| 40 | #include <type_traits> |
| 41 | |
| 42 | #include <__undef_min_max> |
| 43 | |
| 44 | #include <__debug> |
| 45 | |
| 46 | #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) |
| 47 | #pragma GCC system_header |
| 48 | #endif |
| 49 | |
| 50 | _LIBCPP_BEGIN_NAMESPACE_LFTS |
| 51 | |
| 52 | |
Marshall Clow | 81416e4 | 2015-07-20 15:40:27 +0000 | [diff] [blame] | 53 | template <class _ForwardIterator, class _Searcher> |
| 54 | _LIBCPP_INLINE_VISIBILITY |
| 55 | _ForwardIterator search(_ForwardIterator __f, _ForwardIterator __l, const _Searcher &__s) |
Marshall Clow | 28cc4dd | 2016-03-08 15:12:52 +0000 | [diff] [blame] | 56 | { return __s(__f, __l).first; } |
Marshall Clow | 81416e4 | 2015-07-20 15:40:27 +0000 | [diff] [blame] | 57 | |
| 58 | |
Evgeniy Stepanov | 732e268 | 2015-05-13 16:55:41 +0000 | [diff] [blame] | 59 | template <class _PopulationIterator, class _SampleIterator, class _Distance, |
| 60 | class _UniformRandomNumberGenerator> |
Eric Fiselier | e715470 | 2016-08-28 22:14:37 +0000 | [diff] [blame] | 61 | inline _LIBCPP_INLINE_VISIBILITY |
| 62 | _SampleIterator sample(_PopulationIterator __first, _PopulationIterator __last, |
| 63 | _SampleIterator __out, _Distance __n, |
| 64 | _UniformRandomNumberGenerator &&__g) { |
| 65 | return _VSTD::__sample(__first, __last, __out, __n, __g); |
Evgeniy Stepanov | 732e268 | 2015-05-13 16:55:41 +0000 | [diff] [blame] | 66 | } |
| 67 | |
| 68 | _LIBCPP_END_NAMESPACE_LFTS |
| 69 | |
| 70 | #endif /* _LIBCPP_EXPERIMENTAL_ALGORITHM */ |