Header-Only Library - pragma(root)
Walter Bright
newshound2 at digitalmars.com
Mon Jun 15 00:17:42 UTC 2020
On 6/14/2020 8:36 AM, Adam D. Ruppe wrote:
> On Sunday, 14 June 2020 at 10:24:33 UTC, Walter Bright wrote:
>> It would probably be better as the implementer, as a header-only library has
>> to be designed for it.
>
> That's not true. -i just works with almost any D code. It is enormously useful
> exactly the way it is.
If you're building a project using separate compilation, I doubt you'd want an
import with large functions in it being compiled over and over into multiple
object files. Also, you probably don't want dependencies leaking into the
imported code.
More information about the Digitalmars-d
mailing list