FYI: Be careful with imports when using public:

mw m at g.c
Wed Oct 11 04:00:13 UTC 2023


On Tuesday, 10 October 2023 at 07:43:26 UTC, Jonathan M Davis 
wrote:
> I just thought that I'd point this out, since I got bit by it, 
> and others might be in the same boat, but apparently, if you 
> have code such as
>
>     struct Foo
>     {
>     public:
>         import std.range.primitives;
>     ...
>     }


I always try to put all my imports at the top of the source 
files, as long as there is no conflicts -- the same practice as I 
do in Python.

For the reason to avoid any unexpected consequences, e.g. as you 
described.



More information about the Digitalmars-d mailing list