Problem parsing IPv4/IPv6 addresses with std.socket.parseAddress

Vladimir Panteleev via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Sep 28 09:49:54 PDT 2016


On Wednesday, 28 September 2016 at 15:34:56 UTC, Dsciple wrote:
> I don't understand what prevents such function (in turn calling 
> some OS-level C function) from doing its job at compile time 
> too. Guess it's a very challanging thing to do at compile-time, 
> or should I open an issue with the std.socket lib developers?

std.socket simply passes the request on to the operating system. 
Enabling parsing IP addresses at compile time would necessitate 
duplicating the logic already present in the operating system 
libraries, which would not be future-proof at best, and buggy at 
worst.

It's not possible to implement by invoking C functions like at 
runtime, since that is forbidden during compile-time for a number 
of reasons, mainly safety.



More information about the Digitalmars-d-learn mailing list