Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 40 additions & 48 deletions stl/inc/random
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,6 @@ _STL_DISABLE_CLANG_WARNINGS
#pragma push_macro("new")
#undef new

#ifdef _ALLOW_RANDOM_DISTRIBUTION_CONST_OPERATOR
#define _DISTRIBUTION_CONST const
#else
#define _DISTRIBUTION_CONST
#endif

_STD_BEGIN
#define _RNG_PROHIBIT_CHAR(_CheckedType) \
static_assert(!_Is_character<_CheckedType>::value, \
Expand Down Expand Up @@ -1492,12 +1486,12 @@ public:
void reset() noexcept /* strengthened */ {}

template <class _Engine>
_NODISCARD result_type operator()(_Engine& _Eng) _DISTRIBUTION_CONST {
_NODISCARD result_type operator()(_Engine& _Eng) {
return _Eval(_Eng, _Par._Min, _Par._Max);
}

template <class _Engine>
_NODISCARD result_type operator()(_Engine& _Eng, const param_type& _Par0) _DISTRIBUTION_CONST {
_NODISCARD result_type operator()(_Engine& _Eng, const param_type& _Par0) {
return _Eval(_Eng, _Par0._Min, _Par0._Max);
}

Expand Down Expand Up @@ -1634,12 +1628,12 @@ public:
void reset() noexcept /* strengthened */ {} // clear internal state

template <class _Engine>
_NODISCARD result_type operator()(_Engine& _Eng) _DISTRIBUTION_CONST {
_NODISCARD result_type operator()(_Engine& _Eng) {
return _Eval(_Eng, _Par);
}

template <class _Engine>
_NODISCARD result_type operator()(_Engine& _Eng, const param_type& _Par0) _DISTRIBUTION_CONST {
_NODISCARD result_type operator()(_Engine& _Eng, const param_type& _Par0) {
return _Eval(_Eng, _Par0);
}

Expand Down Expand Up @@ -1795,12 +1789,12 @@ public:
void reset() noexcept /* strengthened */ {} // clear internal state

template <class _Engine>
_NODISCARD result_type operator()(_Engine& _Eng) _DISTRIBUTION_CONST {
_NODISCARD result_type operator()(_Engine& _Eng) {
return _Eval(_Eng, _Par);
}

template <class _Engine>
_NODISCARD result_type operator()(_Engine& _Eng, const param_type& _Par0) _DISTRIBUTION_CONST {
_NODISCARD result_type operator()(_Engine& _Eng, const param_type& _Par0) {
return _Eval(_Eng, _Par0);
}

Expand Down Expand Up @@ -1963,12 +1957,12 @@ public:
void reset() noexcept /* strengthened */ {} // clear internal state

template <class _Engine>
_NODISCARD result_type operator()(_Engine& _Eng) _DISTRIBUTION_CONST {
_NODISCARD result_type operator()(_Engine& _Eng) {
return _Eval(_Eng, _Par);
}

template <class _Engine>
_NODISCARD result_type operator()(_Engine& _Eng, const param_type& _Par0) _DISTRIBUTION_CONST {
_NODISCARD result_type operator()(_Engine& _Eng, const param_type& _Par0) {
return _Eval(_Eng, _Par0);
}

Expand Down Expand Up @@ -2135,12 +2129,12 @@ public:
void reset() noexcept /* strengthened */ {} // clear internal state

template <class _Engine>
_NODISCARD result_type operator()(_Engine& _Eng) _DISTRIBUTION_CONST {
_NODISCARD result_type operator()(_Engine& _Eng) {
return _Eval(_Eng, _Par);
}

template <class _Engine>
_NODISCARD result_type operator()(_Engine& _Eng, const param_type& _Par0) _DISTRIBUTION_CONST {
_NODISCARD result_type operator()(_Engine& _Eng, const param_type& _Par0) {
return _Eval(_Eng, _Par0);
}

Expand Down Expand Up @@ -2323,12 +2317,12 @@ public:
void reset() noexcept /* strengthened */ {}

template <class _Engine>
_NODISCARD result_type operator()(_Engine& _Eng) _DISTRIBUTION_CONST {
_NODISCARD result_type operator()(_Engine& _Eng) {
return _Eval(_Eng, _Par);
}

template <class _Engine>
_NODISCARD result_type operator()(_Engine& _Eng, const param_type& _Par0) _DISTRIBUTION_CONST {
_NODISCARD result_type operator()(_Engine& _Eng, const param_type& _Par0) {
return _Eval(_Eng, _Par0);
}

Expand Down Expand Up @@ -2456,12 +2450,12 @@ public:
void reset() noexcept /* strengthened */ {} // clear internal state

template <class _Engine>
_NODISCARD result_type operator()(_Engine& _Eng) _DISTRIBUTION_CONST {
_NODISCARD result_type operator()(_Engine& _Eng) {
return _Eval(_Eng, _Par);
}

template <class _Engine>
_NODISCARD result_type operator()(_Engine& _Eng, const param_type& _Par0) _DISTRIBUTION_CONST {
_NODISCARD result_type operator()(_Engine& _Eng, const param_type& _Par0) {
return _Eval(_Eng, _Par0);
}

Expand Down Expand Up @@ -2784,12 +2778,12 @@ public:
void reset() noexcept /* strengthened */ {} // clear internal state

template <class _Engine>
_NODISCARD result_type operator()(_Engine& _Eng) _DISTRIBUTION_CONST {
_NODISCARD result_type operator()(_Engine& _Eng) {
return _Eval(_Eng, _Par);
}

template <class _Engine>
_NODISCARD result_type operator()(_Engine& _Eng, const param_type& _Par0) _DISTRIBUTION_CONST {
_NODISCARD result_type operator()(_Engine& _Eng, const param_type& _Par0) {
return _Eval(_Eng, _Par0);
}

Expand Down Expand Up @@ -2973,12 +2967,12 @@ public:
void reset() noexcept /* strengthened */ {} // clear internal state

template <class _Engine>
_NODISCARD result_type operator()(_Engine& _Eng) _DISTRIBUTION_CONST {
_NODISCARD result_type operator()(_Engine& _Eng) {
return _Eval(_Eng, _Par);
}

template <class _Engine>
_NODISCARD result_type operator()(_Engine& _Eng, const param_type& _Par0) _DISTRIBUTION_CONST {
_NODISCARD result_type operator()(_Engine& _Eng, const param_type& _Par0) {
return _Eval(_Eng, _Par0);
}

Expand Down Expand Up @@ -3107,12 +3101,12 @@ public:
void reset() noexcept /* strengthened */ {} // clear internal state

template <class _Engine>
_NODISCARD result_type operator()(_Engine& _Eng) _DISTRIBUTION_CONST {
_NODISCARD result_type operator()(_Engine& _Eng) {
return _Eval(_Eng, _Par);
}

template <class _Engine>
_NODISCARD result_type operator()(_Engine& _Eng, const param_type& _Par0) _DISTRIBUTION_CONST {
_NODISCARD result_type operator()(_Engine& _Eng, const param_type& _Par0) {
return _Eval(_Eng, _Par0);
}

Expand Down Expand Up @@ -3241,12 +3235,12 @@ public:
void reset() noexcept /* strengthened */ {} // clear internal state

template <class _Engine>
_NODISCARD result_type operator()(_Engine& _Eng) _DISTRIBUTION_CONST {
_NODISCARD result_type operator()(_Engine& _Eng) {
return _Eval(_Eng, _Par);
}

template <class _Engine>
_NODISCARD result_type operator()(_Engine& _Eng, const param_type& _Par0) _DISTRIBUTION_CONST {
_NODISCARD result_type operator()(_Engine& _Eng, const param_type& _Par0) {
return _Eval(_Eng, _Par0);
}

Expand Down Expand Up @@ -3365,12 +3359,12 @@ public:
void reset() noexcept /* strengthened */ {} // clear internal state

template <class _Engine>
_NODISCARD result_type operator()(_Engine& _Eng) _DISTRIBUTION_CONST {
_NODISCARD result_type operator()(_Engine& _Eng) {
return _Eval(_Eng, _Par);
}

template <class _Engine>
_NODISCARD result_type operator()(_Engine& _Eng, const param_type& _Par0) _DISTRIBUTION_CONST {
_NODISCARD result_type operator()(_Engine& _Eng, const param_type& _Par0) {
return _Eval(_Eng, _Par0);
}

Expand Down Expand Up @@ -3495,12 +3489,12 @@ public:
void reset() noexcept /* strengthened */ {} // clear internal state

template <class _Engine>
_NODISCARD result_type operator()(_Engine& _Eng) _DISTRIBUTION_CONST {
_NODISCARD result_type operator()(_Engine& _Eng) {
return _Eval(_Eng, _Par);
}

template <class _Engine>
_NODISCARD result_type operator()(_Engine& _Eng, const param_type& _Par0) _DISTRIBUTION_CONST {
_NODISCARD result_type operator()(_Engine& _Eng, const param_type& _Par0) {
return _Eval(_Eng, _Par0);
}

Expand Down Expand Up @@ -3689,12 +3683,12 @@ public:
void reset() noexcept /* strengthened */ {} // clear internal state

template <class _Engine>
_NODISCARD result_type operator()(_Engine& _Eng) _DISTRIBUTION_CONST {
_NODISCARD result_type operator()(_Engine& _Eng) {
return _Eval(_Eng, _Par);
}

template <class _Engine>
_NODISCARD result_type operator()(_Engine& _Eng, const param_type& _Par0) _DISTRIBUTION_CONST {
_NODISCARD result_type operator()(_Engine& _Eng, const param_type& _Par0) {
return _Eval(_Eng, _Par0);
}

Expand Down Expand Up @@ -3824,12 +3818,12 @@ public:
void reset() noexcept /* strengthened */ {} // clear internal state

template <class _Engine>
_NODISCARD result_type operator()(_Engine& _Eng) _DISTRIBUTION_CONST {
_NODISCARD result_type operator()(_Engine& _Eng) {
return _Eval(_Eng, _Par);
}

template <class _Engine>
_NODISCARD result_type operator()(_Engine& _Eng, const param_type& _Par0) _DISTRIBUTION_CONST {
_NODISCARD result_type operator()(_Engine& _Eng, const param_type& _Par0) {
return _Eval(_Eng, _Par0);
}

Expand Down Expand Up @@ -3970,12 +3964,12 @@ public:
void reset() noexcept /* strengthened */ {} // clear internal state

template <class _Engine>
_NODISCARD result_type operator()(_Engine& _Eng) _DISTRIBUTION_CONST {
_NODISCARD result_type operator()(_Engine& _Eng) {
return _Eval(_Eng, _Par);
}

template <class _Engine>
_NODISCARD result_type operator()(_Engine& _Eng, const param_type& _Par0) _DISTRIBUTION_CONST {
_NODISCARD result_type operator()(_Engine& _Eng, const param_type& _Par0) {
return _Eval(_Eng, _Par0);
}

Expand Down Expand Up @@ -4184,12 +4178,12 @@ public:
}

template <class _Engine>
_NODISCARD result_type operator()(_Engine& _Eng) _DISTRIBUTION_CONST {
_NODISCARD result_type operator()(_Engine& _Eng) {
return _Invoke_param_pcdf(_Eng, _Par._Pcdf);
}

template <class _Engine>
_NODISCARD result_type operator()(_Engine& _Eng, const param_type& _Par0) _DISTRIBUTION_CONST {
_NODISCARD result_type operator()(_Engine& _Eng, const param_type& _Par0) {
return _Invoke_param_pcdf(_Eng, _Par0._Pcdf);
}

Expand Down Expand Up @@ -4346,12 +4340,12 @@ public:
void reset() noexcept /* strengthened */ {} // clear internal state

template <class _Engine>
_NODISCARD result_type operator()(_Engine& _Eng) _DISTRIBUTION_CONST {
_NODISCARD result_type operator()(_Engine& _Eng) {
return _Eval(_Eng, _Par);
}

template <class _Engine>
_NODISCARD result_type operator()(_Engine& _Eng, const param_type& _Par0) _DISTRIBUTION_CONST {
_NODISCARD result_type operator()(_Engine& _Eng, const param_type& _Par0) {
return _Eval(_Eng, _Par0);
}

Expand Down Expand Up @@ -4395,7 +4389,7 @@ public:
}

template <class _Engine>
result_type _Eval(_Engine& _Eng, const param_type& _Par0) _DISTRIBUTION_CONST {
result_type _Eval(_Engine& _Eng, const param_type& _Par0) {
size_t _Px = discrete_distribution<size_t>::_Invoke_param_pcdf(_Eng, _Par0._Base_params._Pcdf);
uniform_real_distribution<_Ty> _Dist(_Par0._Bvec[_Px], _Par0._Bvec[_Px + 1]);
return _Dist(_Eng);
Expand Down Expand Up @@ -4621,12 +4615,12 @@ public:
void reset() noexcept /* strengthened */ {} // clear internal state

template <class _Engine>
_NODISCARD result_type operator()(_Engine& _Eng) _DISTRIBUTION_CONST {
_NODISCARD result_type operator()(_Engine& _Eng) {
return _Eval(_Eng, _Par);
}

template <class _Engine>
_NODISCARD result_type operator()(_Engine& _Eng, const param_type& _Par0) _DISTRIBUTION_CONST {
_NODISCARD result_type operator()(_Engine& _Eng, const param_type& _Par0) {
return _Eval(_Eng, _Par0);
}

Expand Down Expand Up @@ -4671,7 +4665,7 @@ public:
}

template <class _Engine>
result_type _Eval(_Engine& _Eng, const param_type& _Par0) _DISTRIBUTION_CONST {
result_type _Eval(_Engine& _Eng, const param_type& _Par0) {
size_t _Px = discrete_distribution<size_t>::_Invoke_param_pcdf(_Eng, _Par0._Pcdf);
double _Px0 = _Par0._Pvec[_Px];
double _Px1 = _Par0._Pvec[_Px + 1];
Expand Down Expand Up @@ -4738,8 +4732,6 @@ public:
};
_STD_END

#undef _DISTRIBUTION_CONST

#pragma pop_macro("new")
_STL_RESTORE_CLANG_WARNINGS
#pragma warning(pop)
Expand Down
1 change: 0 additions & 1 deletion tests/std/test.lst
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ tests\GH_001600_random_inheritance
tests\GH_001638_dllexport_derived_classes
tests\GH_001850_clog_tied_to_cout
tests\GH_001858_iostream_exception
tests\GH_001912_random_distribution_operator_const
tests\GH_001914_cached_position
tests\GH_001923_filesystem_long_path_support
tests\GH_002030_asan_annotate_string
Expand Down

This file was deleted.

This file was deleted.