Author: marshall Date: Wed Sep 20 11:32:08 2017 New Revision: 313789 URL: http://llvm.org/viewvc/llvm-project?rev=313789&view=rev Log: Mark the __eval methods on independent_bits_engine (and __independent_bits_engine) as const, since they make no changes to the object. NFC.
Modified: libcxx/trunk/include/algorithm libcxx/trunk/include/random Modified: libcxx/trunk/include/algorithm URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/algorithm?rev=313789&r1=313788&r2=313789&view=diff ============================================================================== --- libcxx/trunk/include/algorithm (original) +++ libcxx/trunk/include/algorithm Wed Sep 20 11:32:08 2017 @@ -2962,8 +2962,8 @@ public: result_type operator()() {return __eval(integral_constant<bool, _Rp != 0>());} private: - result_type __eval(false_type); - result_type __eval(true_type); + result_type __eval(false_type) const; + result_type __eval(true_type) const; }; template<class _Engine, class _UIntType> @@ -3004,14 +3004,14 @@ __independent_bits_engine<_Engine, _UInt template<class _Engine, class _UIntType> inline _UIntType -__independent_bits_engine<_Engine, _UIntType>::__eval(false_type) +__independent_bits_engine<_Engine, _UIntType>::__eval(false_type) const { return static_cast<result_type>(__e_() & __mask0_); } template<class _Engine, class _UIntType> _UIntType -__independent_bits_engine<_Engine, _UIntType>::__eval(true_type) +__independent_bits_engine<_Engine, _UIntType>::__eval(true_type) const { const size_t _WRt = numeric_limits<result_type>::digits; result_type _Sp = 0; Modified: libcxx/trunk/include/random URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/random?rev=313789&r1=313788&r2=313789&view=diff ============================================================================== --- libcxx/trunk/include/random (original) +++ libcxx/trunk/include/random Wed Sep 20 11:32:08 2017 @@ -3124,8 +3124,8 @@ public: private: _LIBCPP_INLINE_VISIBILITY - result_type __eval(false_type); - result_type __eval(true_type); + result_type __eval(false_type) const; + result_type __eval(true_type) const; template <size_t __count> _LIBCPP_INLINE_VISIBILITY @@ -3151,14 +3151,14 @@ private: template<class _Engine, size_t __w, class _UIntType> inline _UIntType -independent_bits_engine<_Engine, __w, _UIntType>::__eval(false_type) +independent_bits_engine<_Engine, __w, _UIntType>::__eval(false_type) const { return static_cast<result_type>(__e_() & __mask0); } template<class _Engine, size_t __w, class _UIntType> _UIntType -independent_bits_engine<_Engine, __w, _UIntType>::__eval(true_type) +independent_bits_engine<_Engine, __w, _UIntType>::__eval(true_type) const { result_type _Sp = 0; for (size_t __k = 0; __k < __n0; ++__k) _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits