C++ Logo

std-discussion

Advanced search

Re: Odr-use

From: Ville Voutilainen <ville.voutilainen_at_[hidden]>
Date: Thu, 14 Nov 2024 13:47:42 +0200
On Thu, 14 Nov 2024 at 13:09, Russell Shaw via Std-Discussion
<std-discussion_at_[hidden]> wrote:

> So "struct S { static const int x = 0; };" 'defines' 'S::x' because it has an
> initializer, yet has no memory location ?

Right, it has no memory location, but the value is known, and known
not to change, so anything
that just uses the value but doesn't need the address can simply be
replaced by that value.

Received on 2024-11-14 11:47:56