[swift-users] protocol where clause problem

2017-01-11 Thread adelzhang via swift-users
hello all! I'm wondering if somebody can explain following snippet to me. protocol P { associatedtype Element func next() -> Element } protocol Q { associatedtype T : P func makeT() -> T } extension Q where Self.T == Self { func

Re: [swift-users] [unrelated-to-swift] an issue with structs in C++?

2017-01-11 Thread Saagar Jha via swift-users
Looks like someone’s trying to solve the Mt. Chiliad Mystery :) Anyways, it appears that “Epsilon Building” has 5 members instead of 4. That’s probably causing the issue. Saagar Jha > On Jan 11, 2017, at 8:46 PM, Ethin Probst via swift-users > wrote: > > Hello all, >

[swift-users] [unrelated-to-swift] an issue with structs in C++?

2017-01-11 Thread Ethin Probst via swift-users
Hello all, I have the following structured array: static struct { LPCSTR text; float x; float y; float z; } lines[5] = { { "MARKER" }, {

Re: [swift-users] [swift-evolution] Best way to handle escaping function that might throw

2017-01-11 Thread Howard Lovatt via swift-users
Yes, I have used Result in the past. In this case I wanted to use throws because that is what functions like map do. Looks like I will have to stick with throwing, not too bad since the overhead is reasonably low. On Wed, 11 Jan 2017 at 8:03 am, T.J. Usiyan wrote: > I

Re: [swift-users] [swift-evolution] Best way to handle escaping function that might throw

2017-01-11 Thread Howard Lovatt via swift-users
Another possibility, other than generics, would be to drop rethrows all together and have the compiler infer if a throw is possible or not, including: struct FStore { let f: () throws -> Void func call() throws { try f() } } The compiler can make two versions, one if f

Re: [swift-users] for i in 0...UInt8.max

2017-01-11 Thread Quinn "The Eskimo!" via swift-users
On 11 Jan 2017, at 13:06, tuuranton--- via swift-users wrote: > These codes used to crash in earlier Swifts. Can you explain why? We now have the notion of `ClosedRange`, which can represent all values in an integer type (at the cost of introducing the complexity of

[swift-users] for i in 0...UInt8.max

2017-01-11 Thread tuuranton--- via swift-users
I'm looking at Swift 3.0.1 now. This code works fine: for i in 0..___ swift-users mailing list swift-users@swift.org https://lists.swift.org/mailman/listinfo/swift-users

Re: [swift-users] CNLabeledValue var

2017-01-11 Thread German Laullon via swift-users
Thanks, var toExcludeOrCopy : AnyObject? Could help me on some cases... But if I try this: var props = [AnyObject]() props += contact.phoneNumbers ( "contact" is as CNContact, so "contact.phoneNumbers" is [CNLabeledValue] ) I get this error:

Re: [swift-users] C-function not found by linker

2017-01-11 Thread Rien via swift-users
Sometimes you just have to post a stupid question to see what you did wrong :-( So please disregard…. PS: it was of course the “static” (I have no clue why I did put that in there… oh well) Regards, Rien Site: http://balancingrock.nl Blog: http://swiftrien.blogspot.com Github: