DIP10005: Dependency-Carrying Declarations is now available for community feedback
Andrei Alexandrescu via Digitalmars-d
digitalmars-d at puremagic.com
Fri Dec 23 04:50:58 PST 2016
On 12/22/16 9:53 PM, Chris Wright wrote:
> In point of fact, selective and static imports should be *faster* than
> Andrei's way. Consider:
>
> static import myapp.users, std.socket;
> bool isUserOnline(myapp.users.User user, std.socket.Socket socket);
>
> This has to locate a declaration named `User` in myapp.users, and it has
> to locate a declaration named `Socket` in std.socket.
>
> But let's look at Andrei's way:
>
> bool isUserOnline(User user, Socket userSocket)
> import myapp.users, std.socket;
with (static import myapp.users, std.socket)
bool isUserOnline(myapp.users.User user, std.socket.Socket socket);
Andrei
More information about the Digitalmars-d
mailing list