C++ Logo

std-proposals

Advanced search

Re: [std-proposals] [WIP Draft Proposal] Support for compiling libraries + linkage in the C++ Language

From: Jason McKesson <jmckesson_at_[hidden]>
Date: Mon, 26 Jun 2023 18:40:24 -0400
On Mon, Jun 26, 2023 at 3:23 PM Thiago Macieira via Std-Proposals
<std-proposals_at_[hidden]> wrote:
> Either way, that doesn't change the conclusion: libraries exist and there's
> reason to standardise existing practice, without detriment of the < 0.01% of
> users who don't use libraries at all.

OK: *what* gets standardized?

Outside of the specific nature of shared libraries, what *exactly* is
it that people are talking about standardizing here?

My understanding of static libraries is that they are, to the C++
abstract model, just a bunch of translation units. There's nothing
special about them. They're translation units. Any `static` constructs
can't be accessed from outside the TU that created them, whether
you're part of that library or not. Any global construct could be
accessed by any code that links to the library, because the library is
just a bunch of TUs and you can access global constructs declared in
one TU from another TU so long as you have a matching declaration.

So what "existing practice" here *needs* to be standardized to create
portability?

Received on 2023-06-26 22:40:38