On 10/15/2022 11:56 PM, Andrey Tarasevich wrote:
> On 10/15/2022 11:50 PM, Chris M. Thomasson wrote:
>> On 10/15/2022 11:05 PM, Andrey Tarasevich wrote:
>>> On 10/15/2022 11:00 PM, Chris M. Thomasson wrote:
>>>> On 10/15/2022 10:53 PM, Andrey Tarasevich wrote:
>>>>> On 10/15/2022 9:47 PM, Chris M. Thomasson wrote:
>>>>>> Is this code okay, or busted in some way? In reference to the
>>>>>> following thread:
>>>>>>
>>>>>> (static array of reference_wrapper)
>>>>>>
https://groups.google.com/g/comp.lang.c++/c/_RszdtnypkE
>>>>>>
>>>>>> Well, what horrors lie below? ;^)
>>>>>
>>>>> Why would there be? I don't see any potential for any problems there.
>>>>>
>>>>
>>>> Needing to use indirection wrt not being able to have a raw array of
>>>> references.
>>>
>>> But that's what `std::reference_wrapper<>` is for.
>>>
>>
>> It works for sure. However, it seems like:
>>
>> static foo g_foo[] = { { 0 }, { 1 } };
>> static foo& g_foo_ref[] = { g_foo[0], g_foo[1] };
>>
>> should work as well, but it does not. I forgot the reason why.
>
> The reason for "there shall be no no arrays of references"?
Yup. That was it! Thanks for refreshing my memory Andrey. Btw, I was
never really a C++ guy, so to speak. C is my main language.