Permalink
Browse files

c++14/17 change for random_shuffle

	modified:   src/cl-stl-algorithm.lisp
	modified:   src/cl-stl-base.lisp
	modified:   src/user-pacakge.lisp
  • Loading branch information...
show-matz committed Jan 1, 2019
1 parent 7d1c53a commit 62aa665b99ea279cc60fe159f8f81293dabe0f89
Showing with 16 additions and 2 deletions.
  1. +13 −0 src/cl-stl-algorithm.lisp
  2. +2 −1 src/cl-stl-base.lisp
  3. +1 −1 src/user-pacakge.lisp
@@ -12232,6 +12232,7 @@
; last : randomaccess_iterator
; rand : unary_function ( default : #'random )
; returns : nil.
#+(or cl-stl-0x98 cl-stl-0x11 cl-stl-0x14)
(locally (declare (optimize speed))

;;PTN; random_shuffle : 0 - r
@@ -12250,9 +12251,15 @@
(_= *itr tmp))))))))

(defmethod-overload random_shuffle ((first randomaccess_iterator) (last randomaccess_iterator))
#+cl-stl-warn-deprecated
(progn
#+cl-stl-0x14 (warn "random_shuffle is deprecated."))
(__random_shuffle-imp-0 first last #'random))

(defmethod-overload random_shuffle ((first randomaccess_iterator) (last randomaccess_iterator) rand)
#+cl-stl-warn-deprecated
(progn
#+cl-stl-0x14 (warn "random_shuffle is deprecated."))
(__random_shuffle-imp-0 first last (functor_function (clone rand)))))


@@ -12270,13 +12277,19 @@
(swap (aref buffer (the fixnum (+ idx1 n))) (aref buffer idx)))))))

(defmethod-overload random_shuffle ((first vector-pointer) (last vector-pointer))
#+cl-stl-warn-deprecated
(progn
#+cl-stl-0x14 (warn "random_shuffle is deprecated."))
;;(format t "specialized random_shuffle for vector-pointer is invoked.~%")
(__pointer-check-iterator-range first last)
(__random_shuffle-imp-1 (opr::vec-ptr-index first)
(opr::vec-ptr-index last)
(opr::vec-ptr-buffer first) #'random))

(defmethod-overload random_shuffle ((first vector-pointer) (last vector-pointer) rand)
#+cl-stl-warn-deprecated
(progn
#+cl-stl-0x14 (warn "random_shuffle is deprecated."))
;;(format t "specialized random_shuffle for vector-pointer is invoked.~%")
(__pointer-check-iterator-range first last)
(__random_shuffle-imp-1 (opr::vec-ptr-index first)
@@ -321,7 +321,7 @@
:reverse_copy
:rotate
:rotate_copy
:random_shuffle
#+(or cl-stl-0x98 cl-stl-0x11 cl-stl-0x14) :random_shuffle
#-cl-stl-0x98 :shuffle
; 25.2.12, partitions:
#-cl-stl-0x98 :is_partitioned
@@ -1779,6 +1779,7 @@
iterator pointing to the end of copied sequence.
"))

#+(or cl-stl-0x98 cl-stl-0x11 cl-stl-0x14)
(declare-method-overload random_shuffle (2 3)
:documentation "
<<signature>>
@@ -318,7 +318,7 @@
:reverse_copy
:rotate
:rotate_copy
:random_shuffle
#+(or cl-stl-0x98 cl-stl-0x11 cl-stl-0x14) :random_shuffle
#-cl-stl-0x98 :shuffle
; 25.2.12, partitions:
#-cl-stl-0x98 :is_partitioned

0 comments on commit 62aa665

Please sign in to comment.