File indexing completed on 2026-05-03 08:13:46
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef _LIBCPP___LIBCXX_DEBUG_RANDOMIZE_RANGE_H
0010 #define _LIBCPP___LIBCXX_DEBUG_RANDOMIZE_RANGE_H
0011
0012 #include <__config>
0013
0014 #ifdef _LIBCPP_DEBUG_RANDOMIZE_UNSPECIFIED_STABILITY
0015 # include <__algorithm/shuffle.h>
0016 # include <__type_traits/is_constant_evaluated.h>
0017 #endif
0018
0019 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
0020 # pragma GCC system_header
0021 #endif
0022
0023 _LIBCPP_BEGIN_NAMESPACE_STD
0024
0025 template <class _AlgPolicy, class _Iterator, class _Sentinel>
0026 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 void __debug_randomize_range(_Iterator __first, _Sentinel __last) {
0027 #ifdef _LIBCPP_DEBUG_RANDOMIZE_UNSPECIFIED_STABILITY
0028 # ifdef _LIBCPP_CXX03_LANG
0029 # error Support for unspecified stability is only for C++11 and higher
0030 # endif
0031
0032 if (!__libcpp_is_constant_evaluated())
0033 std::__shuffle<_AlgPolicy>(__first, __last, __libcpp_debug_randomizer());
0034 #else
0035 (void)__first;
0036 (void)__last;
0037 #endif
0038 }
0039
0040 _LIBCPP_END_NAMESPACE_STD
0041
0042 #endif