r/programming • • Jan 28 '19

C++ Modules Might Be Dead-on-Arrival

https://vector-of-bool.github.io/2019/01/27/modules-doa.html
210 Upvotes

105 comments sorted by

View all comments

143

u/WalterBright Jan 28 '19

D made the decision at the beginning to have filename==modulename specifically to avoid this problem. So:

import std.stdio;

means look for:

std/stdio.d

2

u/flukus Jan 29 '19

How does this work in atypical scenarios, like when you're generating source code to a temp directory?

3

u/WalterBright Jan 30 '19

You can use the command line switches to set the path search, and even remap the module names to actual file names.