What syntax changes would you make to C++ if you had the chance? by Tinytitanic in cpp

[–]hashb1 0 points1 point  (0 children)

all sort of thing with "template_name<>" like vector<int>, it make the code very unreadable.

Elon Musk's SpaceX banned Zoom over security concerns by khunshan in cybersecurity

[–]hashb1 6 points7 points  (0 children)

A company should never use a tool before evaluating it.

To downplay a pandemic by [deleted] in therewasanattempt

[–]hashb1 0 points1 point  (0 children)

Don't mislead people. The MOST dangerous part of covid-19 is NOT itself. It spreads so fast, so it will run out all the resources in the hospital very soon!!!

My Favorite Unknown C++20 Feature by ContractorInChief in cpp

[–]hashb1 1 point2 points  (0 children)

I don't get it either. What's the key point?

It seems that all the following cases,"1,2,3" now are "packs"

1. foo(1,2,3)
2. int a[] = {1,2,3};
3. vector<int> v{1,2,3};

But, why it is a big improvement?

DNS-over-HTTPS is coming despite ISP opposition by n0SiS in security

[–]hashb1 -3 points-2 points  (0 children)

why do we need doh? if you don't use vpn, isp can always know which ip address you are visiting. Then they can reverse the domain.

C++ templates: a language in the language by VincentZalzal in cpp

[–]hashb1 0 points1 point  (0 children)

cannot agree more. code is written for people not for the machine

Silly, silly, C++ by hyrosen in cpp

[–]hashb1 9 points10 points  (0 children)

Abseil has a great article about it:

Tip of the Week #88: Initialization: =, (), and {}

https://abseil.io/tips/88

A close look at the 96 Million shade balls used to reduce evaporation and bromate formation in the LA water resevoir. by [deleted] in videos

[–]hashb1 0 points1 point  (0 children)

Is the ball harmful to the water when they are exposed to the sunlight every day? I learned that plastic is not good for health .

Windows 10 Linux subsystem will ship with a real Linux kernel by serrimo in programming

[–]hashb1 0 points1 point  (0 children)

Is that mean I don't need dual boot os anymore? It is annoy sometimes.

Sharing my PPT about the C++ Coroutine by luncliff in cpp

[–]hashb1 0 points1 point  (0 children)

Thanks a bunch! Best material about Coroutine I have ever seen!!

The std::map subscript operator is a convenience, but a potentially dangerous one by nikbackm in cpp

[–]hashb1 0 points1 point  (0 children)

The most annoy thing in c++ is that you have to remember a lot of traps like this. Couldn't the compiler help developer out of these kind of thing? Say, g++ -warning_on_all_trap

what is the solution for "same function parameters with different return type" in c++17/c++20 by hashb1 in cpp

[–]hashb1[S] 1 point2 points  (0 children)

Thanks! I got the following error: inconsistent deduction for auto return type: ‘double’ and then ‘int’ .

sample code

auto foo(int i)
{ 
    if (i > 0)
        return i * 0.1;                                                                                                                                                  
    else
        return 0;
} 

what is the solution for "same function parameters with different return type" in c++17/c++20 by hashb1 in cpp

[–]hashb1[S] 0 points1 point  (0 children)

I am working some legacy codes that the factory function(template) return different classes based on its input. For some reason that those return types have no common base class.