importing a symbol without specifying a subpackage name

60rntogo 60rntogo at gmail.com
Wed Sep 16 13:30:57 UTC 2020


I have noticed that if I want to import 
std.algorithm.searching.find, each of the following will work:

---
import std.algorithm.searching : find;
import std.algorithm : find;
import std : find;
---

(Although, the last one is probably not the greatest idea.) 
However, if I write my own module:

---
module foo.bar;

struct Bar {}
---

then saying "import foo : Bar;" yields an error "module foo is in 
file 'foo.d' which cannot be read". I'm curious, how is this 
behavior achieved in the standard library?


More information about the Digitalmars-d-learn mailing list