« first day (2120 days earlier)      last day (2828 days later) » 

it seems that static_assert for non-taken branches of constexpr if are still checked =/
i thought one could do something like if constexpr(condition_always_true) { ... } else { static_assert(false, "msg"); }
 
@gnzlbg ...I think there was a long discussion about that.
 
yeah i am reading the paper
it is not proposed
idiots
they almost got it right
 
I think the issue you have there is that the condition is not dependent, so the effectively generated lambdas are not generic.
 
i mean the code inside a constexpr if branch should be syntax checked
but not instantiated
 
12:20 PM
@gnzlbg I mean at the meeting. There was a discussion between CWG and EWG about what should actually happen in this case, but I don't remember the exact conclusion.
 
nwp
@Griwes clicking that gets opera stuck for ~10 seconds
 
I am writing a visitor for a variant
like this
 
@nwp So you're saying Opera can't into redirects?
Funny fact, that quote + full target URL are too long for a snackchat message.
 
nwp
I don't know if it can into redirects, but it is repeatable.
 
std::experimental::visit([](auto&& v) { if constexpr(Same<decltype(v), A>{}) { .... } else { unhandled } }, variant<A, B>{A{}});
I want to force a compilation error if I don't handle a case to get an exhaustive visitor
 
nwp
12:23 PM
1. Send a bug report
2. Update browser
3. Use a different browser
4. Don't worry about it
which to pick....
 
so by putting static_assert(false) in the else branch I force having to match on all vairant types
 
visit(make_overload_set([](A & a) { ... }, [](auto && v){ oops }), variant);
There was a paper for standard make_overload_set, but I'm not positive it got anywhere.
 
yeah but I want a static_assert(false, "you forgot to handle one case!");
what if two types are convertible to each other?
I want to have an exhaustive exact match
 
Also erm, you can't actually do this.
(Not that way.)
 
the if constexpr (Same<T, U>{}) { ... } if (Same<T, V>{}) { ... } else { compile fail })
 
12:24 PM
Because all the code paths will be instantiated either way.
Ah.
 
nwp
2. didn't help
 
That way.
 
i thought the point of constexpr if is to not instantiate the code
 
Do make_overload_set then.
 
yeah but make_overload_set will use overload resolution
 
12:25 PM
@gnzlbg I was confused by your earlier example for a second.
 
if i want that to work properly i need to add overloads for T& T const& T&& for each type
 
Doing a condition on if (is_same<...>()) feels... wrong.
 
with constexpr if I can just do T = uncvref_t<decltype(v)>;
 
@gnzlbg auto &&
 
that's too greedy
 
12:25 PM
Argh.
I'm starting to think too slowly.
 
what i do now is
 
This is why reference collapsing is terrible.
 
else { uninstantiable<T>{}; }
 
And why forwarding references should have been a separate entity.
But no, the committee didn't think about obvious use cases like this.
 
lol it works?
 
12:27 PM
@gnzlbg [](auto && foo) -> enable_if<...>, but that... explodes certain versions of GCC.
 
no it doesnt work
:(
ah
 
I think you've misread me. :P
 
@gnzlbg use a dependent false
mmh not sure that’s gonna work
 
template<typename T> struct fail;
i never define fail
if i handle all cases it works
lol
@LucDanton i just use a template struct that i declare but never define
 
12:44 PM
This shows an example
 
1:16 PM
Wait. constexpr if is a thing in C++17?
And broken on top?
Sigh.
 
@R.MartinhoFernandes no that’s by design
 
:D
Q_Q
Hipsters.
 
This is so fucked up I have no words. :)
 
1:31 PM
@LucDanton but making static assert not work in there is annoying...
frankly static assert should have no effect in a branch of if constrexp that is not taken
 
@ratchetfreak For sanity you need something that has a dependent type to hold onto in the condition, because the underlying mechanism generally implements this using the mechanisms of generic lambdas.
 
@ratchetfreak He meant that it's broken by design.
 
If nothing's dependent, it's hard to make code instantiation delayed without some weird wording.
FYI there was even opposition against even allowing if constexpr outside of generic contexts in EWG.
(Right next to opposition from Bjarne in form of "this will be used as an argument against concepts". Sigh.)
 
yet D had static if for a very long time and it's much nicer to use.
hell the entire compile time computation in D is much better than C++'s
 
Would probably be nice if its community actually existed. :P
You have to remember that C++ is designed by design-by-committee. :P
And I must admit it's kind of hard to grasp what that really means until you actually attend a meeting.
 
1:43 PM
more politics than actual expert judgment I guess
 
Often so, yes.
Though often some people (...BS...) misrepresent technical opposition as political one.
(So while operator. was withdrawn because Core found problems, the rejection of default comparison operators will surely be called a political action.)
I won't say who said this, because I believe that'd be out of line for me, but there was a sentence similar to "I voted against this, because I dislike the general disrespect of Bjarne's opinion in this group" uttered in Oulu.
Which is batshit insane.
No technical arguments, just "start listening to Bjarne or else".
 
anyhow
there is an easily alternative
make a dependent type
 
nwp
default comparisons would have been nice
 
Also there's a rumor that during an interview during the meeting, Bjarne called the committee something similar to "a bunch of drunk idiots".
(In that tone.)
@nwp Not in the form they were proposed, no.
 
you can have template <typename T> struct fail : std::false_type{} and do static_assert(fail<T>{}, "msg");
 
1:50 PM
See, they were proposed in a way that'd make them not be a part of overload resolution.
So first you'd do overload resolution, and if that failed, you'd generate a default one.
More bizarrely, generating it doesn't generate a signature.
And there was no way to opt-out of it.
 
does that mean a silent fallback to the default
 
@ratchetfreak Yes. After all the steps of overload resolution.
I'm pretty sure a lot of people didn't fully understand how many weird and complicated parts that proposal had when coming to Oulu.
 
I wouldn't be surprised if most people don't understand the complicated parts of proposals
 
@Griwes EW
I don't need to read anything else.
REJECT
 
Oh, and there was also no way to explicitly bring them into the overload resolution space, for added fun.
 
1:54 PM
aka basically tacked on without thought of overloads
 
> Matthias reported that when he did a quick check in a large codebase he determined that this proposal would require writing more code than today, because the defaults would not work and extra code would have to be written to prevent them causing problems.
(This is from Oulu minutes.)
> Stroustrup responded that there was an opt-in proposal, and a promise to extend the syntax to do some form of that. Van Eerd requested clarification and Stroustrup said to prevent the defaults you must delete or define your own. He imagined opt-in working by letting you request only less-than or only equality, which would prevent both defaults being generated. Van Eerd replied that that isn't what most people mean by opt-in.
> Snyder said this isn't even an opt-out proposal, because there's no way to request the C++14 behaviour. Deleting the operator is not the same as there being none, w.r.t bases that are comparable. Feature has been redesigned two meetings in a row. Had stronger consensus for the simpler Rapperswil opt-in proposal with =default, which the author decided not to proceed with.
 
WTF
> Had stronger consensus for the simpler Rapperswil opt-in proposal with =default, which the author decided not to proceed with.
Really?
They got it right at first and then fucked up beyond repair?
 
@R.MartinhoFernandes During the meeting this felt much worse, because of operator. screwing up with overload resolution too.
Basically if everything passed in Oulu, we'd have like 3.5 steps of overload resolution.
@R.MartinhoFernandes Yes :D
Welcome to Bjarneworld.
Also, I hate operator. most for making it much harder to read sentences, because it looks like you're ending a sentence there.
 
Xeo
I just want generated member-wise operator== and operator!= with = default ;___;
 
Like most sensible programmers.
 
2:01 PM
I find this really baffling.
Isn't it like, super fucking obvious that it must be with = default?
WTF.
 
Apparently not. vOv
 
I can see a sane (but not very strong) argument against = default, so whatever the syntax.
What matters is it must be opt-in.
 
Xeo
@Griwes Scratch the "most". If this isn't how you want it, you're not a sensible programmer. :P
 
There's no other option.
Just isn't.
 
Also think about the situation of first comparing two things, then defining a comparison operator, and then comparing again.
I think that for a second the paper read ill-formed; no diagnostic required.
 
Xeo
2:03 PM
@R.MartinhoFernandes Something about adding functions that were never there without the = default? For ctors the argument could be made that they would normally be there, barring certain conditions that cause them to vanish.
 
@Xeo Yeah, that.
 
> Jens: This is an option to scream if you disagree.
Gaby: Squawk!
> Jens: [...] The current wording is "no diagnostic in all cases".
Gaby: Squawk!
 
Xeo
@R.MartinhoFernandes We clearly need = read_mind, then.
 
Gabriel made a really funny noise both times.
 
> X: Scream if you think this shouldn't undeniably be strictly opt-in.
*squawks*
X: Those of you who screamed have been banned from committee meetings for life.
^ That's the correct procedure.
 
2:08 PM
The vote at the plenary was 16/31/20 (that's in favor/opposed/abstained).
So there's some hope for the committee. :P
 
Was that for the "opt-out" version?
 
For the only version. :P
 
So opt-in was never voted, you mean?
 
Can hardly call it opt-out, since there's literally no way to opt-out from it.
 
Hence the quotes.
 
2:09 PM
People thought, for a second, that introducing deleted overloads helped...
...but it obviously doesn't, because implicit conversions.
@R.MartinhoFernandes The only paper that got to plenary was this latest broken one.
 
@Griwes People systematically misunderstand = delete.
 
Is there a JVM based language that does not have retarded generics like Java does?
 
What part of it do you not want?
 
2:45 PM
@R.MartinhoFernandes How can it be misunderstood?
 
@gnzlbg People often think the signature is not in the overload resolution candidate set.
 
It is, that is why it mostly only makes sense to add a deleted overload when the signature already was in the overload resolution set.
 
Xeo
3:23 PM
@EtiennedeMartel Depends on your definition of "actual C++11" :P
 
@wilx Scala maybe
Kotlin has non-retarded generics for inline functions, which is enough improvement over Java ones
You can forward type information to the real function with them
 
3:53 PM
@milleniumbug I should read up on both.
NSFW but somewhat interesting: http://img.reflex.cz/img/3/full/2796917_.jpg
 
4:11 PM
Please avoid posting NSFW material on StackOverflow, this is a professional website for programmers and enthusiasts.
 
Isn't using "professional" and "enthusiasts" like that a bit contradictory?
 
Not my wording.
 
Oh, so you don't really believe in the message you're relaying?
 
Are you trying to debase my comment with a non sequitur?
 
No, I'm asking what you meant.
It's confusing because of the use of contradictory terms.
 
Xeo
4:22 PM
Robot, you know who you're talking to, right?
 
Xeo
Well take a guess.
Unless you're trolling too.
 
@R.MartinhoFernandes The web site is "professional", even if some of the users aren't. Exactly what it means for a web site to be professional is a different question--seems to me that it's pretty close to meaningless.
 
@JerryCoffin It's made by people who are paid to make it?
 
@EtiennedeMartel That would make them professionals, but doesn't seem (at least to me) to imply anything about the site itself, unless "professional" when applied to a site means "created by professionals" (but in that case, commercial porn sites would also undoubtedly qualify, so it would imply nothing about NSFW material being off-limits).
 
4:32 PM
In the middle of a national park - it's 2:30am & I have been driving alone for the past 5 & an half hours
Almost there though - 45 more mins or so ...
 
4:48 PM
You're going to run out of gas, also pay attention to the road.
 
5:28 PM
Well this room is dead, is everybody working or something :-)
 
@Mikhail yeah
 
you sold out, man
 
Finishing up week of nerve-racking refactoring.
That's what happens when you own the template library that the entire company uses. Everything you do has the potential to fuck everyone up.
 
Almost done submitting two research papers this week.
I refactored a bunch of hardware device drivers but have no way to test without the hardware... going to ship anyways :-)
 
@Mysticial I own a four-process networked need-all-three-CAP database.
 
5:59 PM
@Mysticial This is where having serious unit tests helps you sleep at night (which I mostly didn't do last nigh, but thankfully for different reasons).
 
@JerryCoffin And I have a shit-ton of them. But most of the code that uses doesn't.
Basically, I save all my large and dangerous changes for around noon. Early enough so that if I break someone, they'll yell at me before the day ends. But late enough that nobody will try to push it into production during trading hours.
 
@Mysticial Yeah, that's rough; not much you can do to force them to do their jobs right.
 
@JerryCoffin Oh, I'm not complaining. I've come to realize that Google is not the norm when it comes to test-strictness.
 
@Mysticial Decades ago, lots of friends of mine used to have conspiracy theories about Microsoft dominating by being crooked. To an extent they were right, but I was convinced that a lot of it was just shooting themselves in the foot a little less than others. I think the same applies to Google to a large extent.
 
@JerryCoffin Another thing is that there isn't much in the way for code-reviews. There isn't enough man-power for that. lol So everyone is basically trusted to do the right thing for the stuff they own.
 
6:08 PM
@Mysticial lol
That's not particularly good. :D
 
@Griwes I'm actually surprised that it hasn't crashed and burned. One big difference that I've noticed is that the turnover rate is much lower than at Google. I've been here for almost 5 months now. And I only know of like 2 people in my department of like 300+ that have left. At Google, people are constantly joining/leaving, transferring. Here, the "owner" of a codebase is usually the original author - who is (by far) the most suitable person to make unreviewed changes.
That's my hypothesis on how the firm can get away without unit-testing and code-reviews.
 
@Mysticial Sort of why companies used to really try to take care of their employees and get them to stay until they retired.
 
6:26 PM
When you think about this a bit, it almost makes sense. Which do you think is more productive?
- One person alone on a project for 5 years.
- 10 people - two at a time, each staying for 1 year.
In terms of raw man power, the second scenario is 2x the first. But if you consider turnover overhead and fact that the guys in the 2nd scenario are not going to know the code-base...
 
@Mysticial The bus factor has to be through the roof.
 
@EtiennedeMartel Yeah, that's why I said "almost" make sense.
 
In my team I value knowledge sharing quite a bit.
I'll accept that a task gets done at a slower pace if it means someone else gets to learn new things.
Also means we get more eyeballs on the same code base, and different perspectives on the same design.
 
@Mysticial In terms of actual improvement, the first may well turn out a fair amount better. In the second scenario, chances are pretty decent that a fair amount of the work done is spent on just undoing the damage they did by failing to understand the code and requirements completely. In theory, tests should eliminate that, but in fact nobody's ever doing to write tests that complete capture all the requirements on a large system. Simply can't be done in most cases.
@EtiennedeMartel I definitely agree with that. I remain convinced that code reviews are probably the single most important part of development.
 
It's cool to have an expert in something on your team, but I prefer to have domain experts rather than feature experts.
Also make sure it's not the same guy doing the review.
 
6:38 PM
my place is a C# shop
we have a small app written in Swift
there's only two of us who know Swift.
so we basically can't really do code reviews on it atm
 
Reviewing is also a great way to learn. But, yeah, I get your point.
 
@EtiennedeMartel I agree. Though part of the reason why I currently don't get code-reviewed, is probably because there's only one other person who knows enough hardware/performance to be qualified to review all my ugly lock-free data-structures. And he's a manager who doesn't have that kind of time.
 
Well not getting reviewed is a good way to make sure your ugly code gets in.
 
Xeo
@Mysticial Teach other people with / through the review.
At my old workplace we didn't have code reviews, and at this place we do.
It's really nice.
Slows down the pace a bit, but the code that comes out at the end is of much higher quality.
 
Btw, I do get code-reviewed, but only stuff which I don't own.
 
Xeo
6:48 PM
We're experimenting with the thought of actually requiring 2 CRs. That's a lot of time spent CRing, but I think we wanna try it for an iteration or two
 
Also nobody here "owns" stuff. The second you git push it's no longer your code.
 
At Google, you need two "approvals". One from the owner of the repo. And one from a "language expert" for code quality. They can be the same person. If you touch multiple repos, you need approvals from an owner for each of them.
 
But again it's not the same reality as yours.
 
Yeah, that's the case here. There are tons of repros and are heavily access gated. They had an issue a few years back where someone tried to steal the trading algorithms. After that, everything is super-locked down.
 
Xeo
Yeah, no real "ownership" here either.
 
6:50 PM
@Mysticial Wait what
 
Most stuff isn't accessible. You need to be explicitly given read or read+write access to certain repos.
 
Xeo
Currently most of my code gets reviewed by the same person, since they built the system I'm extending (player / enemy skills) and nobody else really has a clue of what's going on in there.
 
@EtiennedeMartel I have write access to the template library and read access to much of the infrastructure code. But I have no access to the trading algorithms.
 
Xeo
so they really wanted me for reducing the bus factor
 
@Xeo Isn't it supposed to be, "increase" the bus factor? Lower is bad, higher is better.
 
Xeo
7:01 PM
Depends on how you look at it, eh. "How high is the chance that, in the event of a bus-kill, this project will just drop dead?"
From that pov, higher is worse.
 
I always thought that Bus Factor was lower is worse.
like, "This is the number of people who need to be run over by a bus to tank this project"
 
^^
 
I always heard it as the bus-count, I suppose to remove the ambiguity
 
@jaggedSpire I don't know about you, but it doesn't take multiple buses to run me over before I'm out of commission.
 
lol
I suppose there's still ambiguity there
I've actually never experimentally determined the number of buses required to hit me to put me out of commission, but I suspect it's the population median
 
Xeo
7:16 PM
@Puppy If you take it as "the number of bus-incidents that need to happen", it can be 1 and still kill the project - if the team was on its way to a team event in that bus. :D
 
@Xeo Or they were all standing together and the bus hit a strike.
 
that's why you don't put the team on a bus ;p
give each team member their own individual taxi that takes a separate route
 
Also don't have all your experts get on the same plane for a conference.
 
@Xeo Sounds like your typical technical debt.
 
And now some missile is going to set back AIDS research by how many years?
 
7:18 PM
but then no one will be able to shoot it down over Ukraine and seriously impact the world's collective knowledge in that field
 
Xeo
@EtiennedeMartel Hm, does that actually count as technical debt?
 
@Xeo That sounds more like being undermanned.
 
Xeo
We're lookiiiiing
 
No you don't. we're the ones who are hiring tsk tsk
 
And this why nobody does code-reviews or unit-tests. Too much work, not enough workers.
 
Xeo
7:21 PM
@Mysticial We still do CRs
Working on the testing part.
back-end is "fully" tested
 
Don't wanna sound like a vampire here, but (as a C++ newbie, I'm not one of those one-rep users that starts with C++ - I got other programming exp too), but how would I fix this variable escaping the local scope?
void some_method() {
    SomeStruct some_struct;
    // some code...
    some_member_variable[index] = &some_struct;
}
 
Testing is harder. CRs are easier to rubber stamp.
 
"I don't wanna sound like a vampire, I just want to come in and dump my stupid question"
 
@Puppy too short for SO...
 

C++ Questions and Answers

Solve problems and approach solutions. Just ask and lurkers wi...
 
7:22 PM
@uoɥʇʎPʎzɐɹC ...don't give your member variable the address of a local variable?
 
it's much too boring for the chat
 
@milleniumbug oh shit, didn't know about that one
gosh I'm a noob (with 3,000 rep :P)
 
Xeo
@Mysticial front-end testing is hard, ye
 
@Mysticial Code reviews are way easier to setup than unit tests.
 
the main problem I have with unit testing is deciding when to write them
I have a bunch of code I could write more tests for but it's not clear to me which parts actually have value
 
7:27 PM
Have you tried thinking about it from the other end? Which ones are likely to be the most expensive to fix if they go wrong?
That's how I go about it.
I usually don't do unit tests for stuff that will blow up right away or in integration testing.
 
Ell
@Puppy before you write the code ideally
 
I personally find test-driven development to be a bit of an extreme. You write tests, then write the code. Then find out that what your code does isn't really what you wanted to do so you throw everything out.
I'd say start writing tests when you are reasonably confident that you are past the prototyping phase for some scope.
 
I actually tend to write the basic structure and general cases of the thing, then write tests for those, make sure I got it right, and then use the present interface to figure out what I expect edge cases to do, and then implement the edge cases
 
ello
 
oh I know I'm long past the prototyping phase
 
7:31 PM
so the internal structure winds up structured according to the problem and not convenience and there's no weird-counter-intuitive behavior
this is of course when I write tests while deblobing something
which isn't...as frequently as I want
oh god you're all silently judging me for my sins ;_;
 
yes, yes I am.
 
7:54 PM
.-.
 
The puppy judges everyone except when he doesn't give a fuck.
 
I'll just continue cowering in the corner in shame anyhow :P
 
8:15 PM
Everyone say what you are listening to right now!
- Phutureprimitive - Sub Conscious - Elysium
Everybody is out there getting drunk...
 
the screams of demons as I blast them in the face with a shotty
 
@Puppy Haha. Doom?
 
yeah
Doom is actually a pretty good game
 
8:32 PM
I'm listening to SimCity 3000's soundtrack.
 
@EtiennedeMartel Interesting.
 
@EtiennedeMartel That's a good sound track.
I still play that game every once in a while.
Good times.
 
Yeah, I never got into 4, hows the newest SimCity?
 
We don't talk about SimCity 2013.
If you really want a modern city building game take a look at Cities: Skylines.
SimCity is dead.
 
u_u
 
8:37 PM
Hmm, is there an easy way to prompt a user in Windows for a number without using a widget kit?
 
@Mikhail Hand coding everything in plain C. :)
 
no.
 
I don't mind the plain C, but the old fashioned Windows program bring up feels like overkill for a single promp. For example you can issue an error message box without much effort...
 
@Mikhail Or create a PowerShell script that will create the GUI for you and print the user input into its stdout.
 
Wasn't there some bullshit you could do and call VB?
@wilx that sounds like a good idea, I might try it :-)
 
holy wall of code
 

« first day (2120 days earlier)      last day (2828 days later) »