C++ Logo

std-discussion

Advanced search

Re: Global array of objects over multiple files

From: Federico Kircheis <federico_at_[hidden]>
Date: Sun, 20 Oct 2024 05:05:28 +0000
On 20 October 2024 04:35:16 UTC, Thiago Macieira via Std-Discussion <std-discussion_at_[hidden]> wrote:
>On Saturday 19 October 2024 12:59:31 GMT-7 Federico Kircheis via Std-
>Discussion wrote:
>> const std::string answer_of_life = "42";
>>
>> This line of code, a global constant std::string, can lead to undefined
>> behavior.
>
>You mean an One-Definition Rule violation? That's IFNDR in the Standard.
>

No, look at the examples

Received on 2024-10-20 05:05:42