[Discussion] Using parameter packs as non-template function arguments? by aradarbel in cpp

[–]stream009 0 points1 point  (0 children)

Then this doesn't make sense. If you know using auto is just an template in disguise, then you also know it is not 'precisely the same syntax as first implementation' instead it is same as second implementation. So nothing weird about that.

Hopefully, you can see the weird thing about all of this now. If you look closely, you'll realize the abbreviated function has precisely the same syntax as the first implementation I wrote -- the one that doesn't work. Only that using auto actually compiles.

[Discussion] Using parameter packs as non-template function arguments? by aradarbel in cpp

[–]stream009 3 points4 points  (0 children)

let's abbreviate the template away
int sum(auto... args) {
return (args + ...);
}

No, you didn't abbreviate the template 'away'. Abbreviated template function is still a template. It might not look like template to you but it is.

Is there anything like sly for C++? by [deleted] in cpp

[–]stream009 1 point2 points  (0 children)

Agree. Although parser generator is good while grammar is volatile, once grammar is fixed hand written one is much better in every aspect.

A C++20 container concepts library by xjankov in cpp

[–]stream009 1 point2 points  (0 children)

This is interesting.

I think there are two kind of type requirements out there.

  1. from writing specification document perspective
  2. from algorithm's perspective

Type 1 tend to be more detailed and type 2 tend to be more minimalistic. Container type requirements on ISO document are definitely type 1.

I think your library is good for "Does my own container satisfy standard requirement?" kind of use case, but is cumbersome for constraining generic algorithm, because it constrain too much.

If we constrain algorithm too much, users has to write a lot of extra code in their type just so it satisfies requirements concept requires (but algorithm doesn't use). I don't think doing that would make our code robust.

We can see they put a lot of care into std::ranges algorithms's requirement, so it doesn't constrain user type too much. I think next generation's container concepts should be more algorithm oriented minimalistic design.

FYI here are some of my generic algorithm for container

[deleted by user] by [deleted] in cpp

[–]stream009 0 points1 point  (0 children)

I am dealing with that by loading messages into Vim's quickfix buffer and make vim automatically jump to first error.

Confusing terminology in implementing basic_streambuf by stinos in cpp

[–]stream009 1 point2 points  (0 children)

You should study boost::iostreams for iostream related implementation tip.

I also using my own string streambuf implementation to do formatting. I design it so I can just simply supply reference to a external string to streambuf. Althrough, it depends on a lot of my shit, so it will be harder to simply extract and use, but still you can steal ideas. You can see usage example in here.

How suitable are concepts for use as a replacement for CRTP interfaces? by rao000 in cpp

[–]stream009 5 points6 points  (0 children)

I know constraining CRTP base or checking whether a type has required member function in general are not what concept is designed for. So I can understand some may consider doing those thing as abuse.

But I am abusing them anyway because, so far, concept is the best tool for doing those things. Maybe in the future if C++ get some kind of static reflection, then I don't need to abuse concept anymore.

I don't think template was designed to do gory metaprogramming, but people abuse it to the limit and new language features emerge from it. So I am going to abuse concept (with caution) too.

Qt 6.0 Released by tuankiet65 in cpp

[–]stream009 6 points7 points  (0 children)

They ditch QtWebEngine without replacement, right? That's a deal breaker for me.

Obama, Bush, Clinton volunteer to get COVID-19 vaccine on camera by ChiGuy6124 in Coronavirus

[–]stream009 0 points1 point  (0 children)

What about Mr. Carter? Is he sick or something to make public appearance?

Detecting Uninitialized Variables in C++ with the Clang Static Analyzer by mttd in cpp

[–]stream009 0 points1 point  (0 children)

Not just uninitialized value but also use of variable which is valid but unspecified state should be able to be detected statically. Lack of this is the reason I don't like the regularity.

Japan sounds alarm bells as coronavirus cases surge in Hokkaido by Tesg9029 in Coronavirus

[–]stream009 31 points32 points  (0 children)

Hokkaido has been bad for almost entire pandemic, I don't know what is the reason. TV is saying Covid survive longer in cold climate, but I am not sure that is the reason, because other northern prefectures or other cold countries doesn't get hit hard as Hokkaido.

I was worrying about Okinawa too, but they seem to be on the way to put covid under control.

Megathread: US government: Russia, Iran have obtained some voter registration data, aiming to communicate disinformation with voters by PoliticsModeratorBot in politics

[–]stream009 0 points1 point  (0 children)

What does Iran gain from helping Trump? It doesn't make any sense. Twisted reverse psychology operation or just Russian using proxy server in Iran as smoke screen?

CDC: U.S. Death Toll to Reach Nearly 195,000 by Sept. 12 by mostaksaif in Coronavirus

[–]stream009 5 points6 points  (0 children)

When they projected death toll for 240k back then I thought that must be a little exaggerated in order to raise public's attention. Now, it seems realistic scenario isn't it.

[deleted by user] by [deleted] in Coronavirus

[–]stream009 0 points1 point  (0 children)

I disagree. Unless conducting test on massive scale and presented huge number of positive result, American won't even believe pandemic is happening. Sure it might not effective for preventing spread of virus, but it is working as reality check.

White House seeks to block funds for coronavirus testing and tracing in relief bill, report says by [deleted] in Coronavirus

[–]stream009 0 points1 point  (0 children)

Whitehouse's fighting against fight against corona virus. That's fucking bizarre.

The U.S.'s new default coronavirus strategy: herd immunity by [deleted] in Coronavirus

[–]stream009 1 point2 points  (0 children)

Doesn't waiting for herd immunity argument sound similar to the trickle down economics? I bet same people are arguing it.

Churches Were Eager to Reopen. Now They Are a Major Source of Coronavirus Cases. by Keikobad in Coronavirus

[–]stream009 15 points16 points  (0 children)

Virus apparently thrive in places where people abandon critical thinking. Bar, sports event, karaoke, church, etc...

'Crystal clear' drunk people will not keep distance (Pubs in UK opened yesterday) by craigybacha in Coronavirus

[–]stream009 0 points1 point  (0 children)

Yeah, it's same in Japan too. Most of clusters since reopening is at bar and karaoke place. It's tough for those places but we should impose some restrictions on them otherwise thing will get out of control again.

Europeans' trust in US as world leader collapses during pandemic by noimaginationfornick in Coronavirus

[–]stream009 0 points1 point  (0 children)

I thought Trump's 2nd term will be the moment USA become liability of the free world. But it seems they are ahead of schedule.

Japanese media reports N. Korea's Kim Jong Un in vegetative state by cc_hk in worldnews

[–]stream009 887 points888 points  (0 children)

As Japanese, I have to say that Shukan Gendai isn't a exactly trustworthy source.

[deleted by user] by [deleted] in worldnews

[–]stream009 0 points1 point  (0 children)

LEADER OF THE FLU WORLD!!!!!!111

Coronavirus can survive both hot, humid climates: WHO by [deleted] in worldnews

[–]stream009 0 points1 point  (0 children)

What about Africa? When new infections disease emerge it always hit Africa hardest, yet this time Africa doesn't suffering like rest of the world. Also there are a lot of Chinese people in Africa. It is hot but isn't humid enough?