title: Swift func that takes a Metatype?
body: <p>As Apple says in the <a href="https://developer.apple.com/library/prerelease/ios/documentation/swift/conceptual/swift_programming_language/Types.html#//apple_ref/doc/uid/TP40014097-CH31-XID_1027"><strong>Metatype Type</strong></a> section in Swift's docs:</p>
  
  <blockquote>
    <p>A metatype type refers to the type of any type, including class types, structure types, enumeration types, and protocol types.</p>
  </blockquote>
  
  <p>Is there a base class to refer to any class, struct, enum, or protocol (eg <strong>MetaType</strong>)? </p>
  
  <p>My understanding is that protocol types are limited to use as a generic constraint, because of Self or associated type requirements (well, this is what an Xcode error was telling me). </p>
  
  <p>So, with that in mind, maybe there is a <strong>Class</strong> base class for identifying class references? Or a <strong>Type</strong> base class for all constructable types (class, struct, enum)? Other possibilities could be <strong>Protocol</strong>, <strong>Struct</strong>, <strong>Enum</strong>, and <strong>Closure</strong>.</p>
  
  <p>See this example if you don't get what I mean yet.</p>
  
  <pre><code>func funcWithType (type: Type) {
    // I could store this Type reference in an ivar,
    // as an associated type on a per-instance level.
    // (if this func was in a class, of course)
    self.instanceType = type
  }
  
  funcWithType(String.self)
  funcWithType(CGRect.self)
  </code></pre>
  
  <p>While generics work great with 1-2 constant associated types, I wouldn't mind being able to treat associated types as instance variables.</p>
  
  <p>Thanks for any advice!</p>