C++ Logo

sg16

Advanced search

Re: Agenda for the 2022-11-30 SG16 telecon​; P2693R0 review

From: Jens Maurer <jens.maurer_at_[hidden]>
Date: Wed, 30 Nov 2022 17:24:49 +0100
On 30/11/2022 17.14, Daniel Krügler wrote:
> Am Mi., 30. Nov. 2022 um 17:05 Uhr schrieb Jens Maurer via SG16
> <sg16_at_[hidden]>:
>>
>>
>> On 29/11/2022 23.59, Tom Honermann wrote:
>>> It is still possible to do the bad thing, but one has to be explicit about it. That isn't a concern here.
>>>
>>> std::wcout << std::to_string(std::stacktrace::current()).c_str();
>>
>> Sorry, but
>>
>>
>> #include <string>
>> #include <iostream>
>>
>> int main()
>> {
>> std::wcout << std::string() << std::endl;
>> }
>>
>>
>> doesn't compile for me. I believe your "explicit"
>> example is ill-formed.
>
> Tom's example should work, because std::wcout can write const char*,
> but it cannot write std::string, as you revised example uses.

Ah, I see: the c_str() is on the outside.

Sorry for the noise.

Jens

Received on 2022-11-30 16:24:59