mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
19 lines
334 B
Swift
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()
|