[phobos] isemail error handling

Jacob Carlborg doob at me.com
Sat Mar 5 06:55:07 PST 2011


Yes of course, it's already an enum. I was concerned about the size of the struct or is it small enough to return by value?

-- 
/Jacob Carlborg

On 5 mar 2011, at 14:44, Andrei Alexandrescu wrote:

> Make the status code an enum.
> 
> Andrei
> 
> On 3/5/11 5:07 AM, Jacob Carlborg wrote:
>> The PHP version returns "true", "false" or a code indicating why the email address isn't valid. In addition to that it has an out parameter, an array, containing among other things the local and the domain part of the address. I was thinking that I either keep it like that, with an out parameter, or return a struct with the information.
>> 
>> If I return a struct I was thinking it would contain the following fields:
>> 
>> bool valid;
>> string local;
>> string domain;
>> int statusCode/reasonCode;
>> 
>> And also make the struct implicitly convertible to bool. Would that be too much to return by value?
>> 
> _______________________________________________
> phobos mailing list
> phobos at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/phobos



More information about the phobos mailing list