Files
swift-mirror/test/stdlib/Algorithm.swift
Dave Abrahams b7b3e0b9cd [stdlib] Add policies for Callable things as a workaround for <rdar://problem/13251236>
(remapping bound function type not implemented yet)

Swift SVN r5454
2013-06-03 20:09:34 +00:00

19 lines
334 B
Swift

// RUN: %swift -i %s | FileCheck %s
struct IsSpace : Predicate {
typealias Arguments = CodePoint
typealias Result = Bool
func __call__(c: CodePoint) -> Result {
return c.isSpace()
}
}
func testApply() {
// CHECK: false
println(apply(IsSpace(), 'x'))
// CHECK: true
println(apply(IsSpace(), '\n'))
}
testApply()