On Tue, 2020-05-19, David Brown wrote:
> On 19/05/2020 16:59, Thiago Adams wrote:
>> On Tuesday, May 19, 2020 at 11:06:18 AM UTC-3, David Brown wrote:
>>> On 19/05/2020 14:34, Thiago Adams wrote:
>>>> On Monday, May 18, 2020 at 3:13:12 PM UTC-3, Mr Flibble wrote:
>>>>> Hi!
>>>>>
>>>>> When is C++ getting strong typedefs? I want strong typedefs!
>>>>>
>>>>
>>>> [[ironic]]
>>>>
>>>> Yes. But this feature is too simple. No one wants to propose or
>>>> implement this.
>>>
>>> It turns out that strong typedefs are very hard to define and pin down
>>> exactly what people mean by the term.
>>
>> Just add a warning inside the compiler.
...
> The idea of "strong typedef" is a bit more complicated than that...
To me it appears simple: 'typedef foo bar', and bar will be exactly
like foo, except there will be no conversions between them. But I see
no use case for such a thing ...
The one time in the past when I wanted something like that, it
turned out I really wanted my own template class. I remember asking
here about it in 2009 or so ... I wrote a protocol encoder/decoder
for GTPv2, and the protocol carried a lot of tag-length-value data
which often was some tag, length 4 and a value which was a 32-bit
integer. I ended up with the tag as the template argument, and
typedefs like
typedef Element32<4711> UPTunnelId;
...
>> I would like simple multi platform libs for sockets, console
>> for instance.
>>
>
> These would be almost totally and completely useless to me. Different
> people have different priorities.
>
> And this stuff can all be implemented as libraries - so people can try
> it out and see if particular libraries become popular and useful before
> standardising.
And that hasn't happened yet. For sockets I'm happy with BSD sockets;
they are well-known, work on all machines I care about, and are
documented in manpages and Stevens' books. I'm not that impressed
with Qt's sockets or with Boost.Asio. They are useful, but I wouldn't
want them standardized.
/Jorgen
--
// Jorgen Grahn <grahn@ Oo o. . .
\X/
snipabacken.se> O o .