C++ Logo

sg15

Advanced search

Re: [isocpp-sg15] Module metadata distributed with pre-built libraries

From: Daniel Ruoso <daniel_at_[hidden]>
Date: Thu, 23 May 2024 10:12:58 -0400
On Thu, May 23, 2024, 10:00 Boris Kolpackov <boris_at_[hidden]> wrote:

> Consider a library that only provides modules with inline/template
> implementations. The object files produced for such modules will
> be effectively empty. It feels wasteful to link, install, package,
> etc., a library out of this empty object files.
>

It's not empty, otherwise it would not need an object at all.

If folks want to propose and important an attribute that tells the compiler
nothing can be statically initialized, therefore removing the object
dependency, that's fine.

Alternatively, maybe there's an attribute that tells the compiler or should
generate a weak version of that initializer in every consumer.

But the idea that someone will need to decide whether or not they need to
build a foreign object doesn't have a precedent today, and I, personally,
think would be a really bad thing for the ecosystem.

Daniel

Received on 2024-05-23 14:13:09