title: Array / Stack contains function
body: <p>I would like to give my STACK struct the function contains(element: Element) that returns a bool as to whether var contents contains the element provided.</p>
  
  <pre><code>struct Stack&lt;T&gt;: SequenceType, Equatable, Printable, DebugPrintable {
       typealias Element = T
       private var contents: [Element]
       var top: Int
  
       init(arrayLiteral elements: T...) {
            self.init(elements) }
  
       // easier initialization
       init&lt;S: SequenceType where S.Generator.Element == Element&gt;(_ sequence: S) {
            self.contents = [Element]()
            Swift.map(sequence) {self.contents[$0] = true }
       }
  
       // returns TRUE if the Stack contains &lt;T&gt; 'element'
       func contains(element: Element) -&gt; Bool {
           return contents.filter(element != nil) ?? false
       }
  </code></pre>
  
  <p>I would like to be able to define a new STACK and search its contents like so:</p>
  
  <pre><code> var newStack: Stack = [5, 23, 45, 100]
   newStack.contains(45)                      // returns TRUE
  </code></pre>
  
  <p>Currently the compiler gives an error of:</p>
  
  <p>"Cannot invoke '??' with an argument list of type '(Array, BooleanLiteralConvertible)' "</p>