I have a somewhat complex range I want to assign to a data member of a class.
chain(nicklist,
map!(a=>format("%s%d", nicklist[0], a))(sequence!"n+1"()))
nicklist is just a string[]. Normally my trusty friend auto would just take care of this but for a data member I need to declare the type and I’m at a loss for what that type should be. I’ve tried to figure out how to use typeof() to get it but the runtime arguments confuse me and I haven’t been able to figure out how to formulate it.
(this is being used for an IRC bot. nicklist is a list of nicks I want it to try in order and after it has exhausted all of those with nick collisions it’ll just try the first nick with numbers appended)
This would work:
Another possibility would be to have a function wrap it and then take its return type and use that:
ReturnTypeis in std.traits.