From cabd899188e7882bb17e0e72cc563b52caf48de3 Mon Sep 17 00:00:00 2001 From: Philipp Haller Date: Tue, 8 Mar 2011 15:41:49 +0000 Subject: Added documentation in annotation.unique packag... Added documentation in annotation.unique package object. No review. --- src/library/scala/annotation/unique/package.scala | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/library/scala/annotation/unique/package.scala b/src/library/scala/annotation/unique/package.scala index 7fc4101b7e..1cb652a084 100644 --- a/src/library/scala/annotation/unique/package.scala +++ b/src/library/scala/annotation/unique/package.scala @@ -26,6 +26,16 @@ package object unique { def captured: A = x } + /* Swaps an object stored in a unique field with another unique object. + * + * The unique object that is the new value of the unique field becomes + * unusable by the caller. + * + * @param to the unique field that is the target of the swap + * @param from the unique object that is moved into the unique field + * @return the unique object that was the value of the unique + * field before the swap + */ def swap[A, B <: A](to: A, from: B): A = to } -- cgit v1.2.3