Re: Multiple return type or callback function

2017-01-23 Thread Basile B. via Digitalmars-d-learn
On Monday, 23 January 2017 at 15:15:35 UTC, aberba wrote: I'm creating a function to authenticate user login. I want to determine login failure (Boolean) and error message (will be sent to frontend) but D does have multiple return type [...] Yes, MRV can be done with a tuple auto foo() {

Re: Multiple return type or callback function

2017-01-23 Thread pineapple via Digitalmars-d-learn
On Monday, 23 January 2017 at 15:15:35 UTC, aberba wrote: I'm creating a function to authenticate user login. I want to determine login failure (Boolean) and error message (will be sent to frontend) but D does have multiple return type (IMO could use struct but will make code dirty with too

Multiple return type or callback function

2017-01-23 Thread aberba via Digitalmars-d-learn
I'm creating a function to authenticate user login. I want to determine login failure (Boolean) and error message (will be sent to frontend) but D does have multiple return type (IMO could use struct but will make code dirty with too much custom types). struct Result { bool success =