summaryrefslogblamecommitdiff
path: root/src/library/scala/collection/generic/SetFactory.scala
blob: 72774e659bc59b4eb84819683eb67abe83535bb7 (plain) (tree)
1
2
3
4
5
6
7
8
9



                                                                   

                                                                     
 
                                                                              
 

                                                                  

   
package scala.collection.generic

/** A template for companion objects of Map and subclasses thereof.
 */
abstract class SetFactory[CC[X] <: Set[X] with SetTemplate[X, CC[X]]]
  extends Companion[CC] {

  def newBuilder[A]: Builder[A, CC[A]] = new AddingBuilder[A, CC[A]](empty[A])

  def setBuilderFactory[A] = new BuilderFactory[A, CC[A], CC[_]] {
    def apply(from: CC[_]) = newBuilder[A]
  }
}