« first day (920 days earlier)      last day (4034 days later) » 

7:00 PM
We need another humor detector here.
 
@FredOverflow You don't need to.
 
@Morwenn This is a good suggestion for cppreference actually
It's odd how they don't have categories
 
@Rapptz Would be pretty useful, yeah.
 
Fer sure.
 
7:03 PM
They have a list of these things?!
 
lol
lol, guy bikeshedding make_unique.
 
where
 
std-proposals
 
They wouldn't even discuss the issue of the name if template class constructors did deduce the template types.
 
That wouldn't work here.
 
7:06 PM
How about I don't use typedef and use using instead.
 
I love using using :D
 
If you want it to be used in MSVC you would have to use a typedef
 
make(1, 2, 3) // sure I'll make a... what? straight away
 
@R.MartinhoFernandes Haha :D
By the way, does any of you know what the reason why template class constructors cannot deduce template parameters was?
 
Xeo
@R.MartinhoFernandes I just saw that
@R.MartinhoFernandes He obviously wants an initializer list, d'uh.
 
7:09 PM
So, I need to reboot for VS2012.
See you guys in a few minutes.
 
Xeo
ya
 
@Morwenn I don't understand how that could work except in very trivial scenarios.
Or at least without a bunch of new syntax. Which I believe would amount to writing the factory function anyway.
 
@R.MartinhoFernandes Well, there is a proposal, but no discussion about it, so I hardly see the real matter behind it.
 
@Morwenn Have they voted that in yet?
 
7:11 PM
@Morwenn It probably doesn't bring significant benefit.
 
@FredOverflow I don't think so.
@R.MartinhoFernandes We at least wouldn't have to write a new function just to forward its parameters to the constructor.
 
How often do you write classes that would benefit from it?
 
@MartinJames How old are you, dammit? :D
 
@R.MartinhoFernandes But besides that point, there is indeed no real benefit.
 
tuple is already written. optional too.
 
7:13 PM
Has anybody here used <random>?
 
@Pawnguy7 Just copy the code from a stack overflow answer and don't worry about it ;)
 
Yes.
lol, someone downvoted every single answer here: stackoverflow.com/questions/8695046/…
 
No combos.
 
7:14 PM
@R.MartinhoFernandes why not? :)
 
I once downvoted all but two answers in one question. (one of the exceptions was my own).
There were twenty-something answers in it.
 
Wow.
 
Nothing I am writing, but in blogging about C++11, I don't want to state inaccurate things. As I read it, you can... well, normally you might specify the range every call. IT sounds like you can now sort of... specify this, and every call it will use that instead, which I would think is easier assuming you always want the same range. Is this correct?
 
@R.MartinhoFernandes Was that the reverse string one?
 
And surprisingly it was not rolled back.
@Mysticial Yeah.
 
7:16 PM
@Pawnguy7 The most important thing is that <random> provides better pseudo-randomness than rand.
 
@FredOverflow Better-controlled. There is no reason rand has to be worse.
But rand is primitive and using it correctly is hard.
 
@Mysticial that needs some metatemplate magic to tidy up the ugly constants.
 
Isn't rand linear congruential?
 
@Pawnguy7 You mean the distribution?
 
@R.MartinhoFernandes Yeah, first reboot done.
 
7:17 PM
@R.MartinhoFernandes correct
 
@FredOverflow Are you talking about existing implementations or the spec?
 
@EtiennedeMartel Have you enjoyed the purple ALL CAPS MENUS yet? :)
@R.MartinhoFernandes I dunno :)
 
@Pawnguy7 Then yes, you are correct.
 
@FredOverflow I already have it at home.
 
@FredOverflow Yes, I saw it had the Mersenne Twister.. um... engine? - anyway, that is good.
 
7:17 PM
rand itself I thought was implementation defined.
 
And the first thing I did was to set that registry key to remove the ALL CAPS.
 
Xeo
@Pawnguy7 "Mersenne Twister" sounds cool, that's why I like using it
7
 
@EtiennedeMartel Oh, that's possible? How?
 
There is also one guy that found it funny to add several non-standard distributions in libstdc++ <random> and produce SSE-accelerated code wherever he could in the header.
 
Xeo
And std::mt19937 looks cool too :)
 
7:18 PM
@FredOverflow The spec specifies pretty much nothing, so there is no reason for it to perform worse than the stuff in <random>.
 
16
Q: Can you turn off all caps on the menus in VS2012?

BlackICEThe all caps in the menus for VS2012 is highly annoying, is there a setting somewhere in the IDE or elsewhere to turn it off?

 
The problem with rand is that rolling a die correctly is a nightmare. (and being global too)
 
Xeo
@EtiennedeMartel SuppressUppercaseConversion <3
 
@R.MartinhoFernandes ...except for efficiency ;-)
 
rand() % 6? Nope.
 
7:19 PM
@R.MartinhoFernandes Jesus saves, everyone else takes rand() % 11 + 1 damage.
 
Xeo
Hm.. nobody discussing []proposal :(
 
@FredOverflow ...usually, anyway. In theory, rand() could be built around a good generator -- it just happens that it's fairly unusual.
 
With <random> rolling a die is super easy.
 
@Xeo Frankly
 
Xeo
Maybe people just don't want it...
 
7:20 PM
ignore isocpp's proposals forum.
 
@Xeo Just think of it as ahead of its time but a killer proposal in the future.
 
as the only one here who has actually presented any proposals before Committee, I can tell you that it's response is worth jack shit
 
Xeo
That reminds me, I wanted to fix the [](<operator>) syntax part
@DeadMG *its
 
whatever
 
7:21 PM
@JerryCoffin Yeah, it could be built around <random>!
 
DAmmit.
 
not only do a good chunk of proposals not go through isocpp, but the Committee's reaction is often totally different
 
What's up with 20.7.1.2/9-14? is that some black magic to allow you to move ownership and change the deleter type?
 
@DeadMG Your mom is worth jack shit.
 
lol
 
7:22 PM
it took five minutes for Stephan to rip apart N3573 compared to all the time it was on isocpp
and even less time for Jeffrey Yaskin to kill N3574
 
@R.MartinhoFernandes That's harsh.
 
Jeffrey is active on the forums, though.
 
@DeadMG Ha, told you it would suck.
 
his posts in the N3572 feedback thread were the only times I've ever seen him post
 
(Even though I can't say why)
 
7:24 PM
Searching for "yasskin" in my mailbox gives 85 results.
 
well, he certainly didn't feed back on N3572 before
 
By the way, why did you think of static if before it was considered pure evil?
 
@DeadMG And it was good feedback.
@Morwenn lol, pure evil.
 
So rand() is/was implementation defined?
 
People were like enthusiast, then those standard guys have been like "don't want that shit in our language". Funny enough.
 
Xeo
7:25 PM
@rubenvb Are we talking about the same paragraphs here? 20.7.1.2 only goes to p4 for me
 
@R.MartinhoFernandes Right. All I'm saying is that if the responders to proposals consisted of Jon, Alan, Stephan, Alisdair and Jeffrey, you'd get far higher quality proposals at the meetings.
 
@Xeo 20.7.1.2.1, but I'm writing up a SO question. Give me a sec, then you can harvest rep ;-)
 
Xeo
@Morwenn I still like the idea of easier conditional compilation based on template arguments
 
@Morwenn And in all honesty, there is a lot of shit being suggested around in the forums.
 
7:27 PM
@DeadMG Actually, I did present a proposal to the committee (well, a committee, anyway -- the C committee) once upon a time (when they met in Colorado -- around 1997 or 1998, if memory serves).
 
I remember when it started and some guy wanted free-for-all pointer conversions.
 
@Xeo I also liked how simple it was. But most of what has been said in the paper against static if was true.
 
Can someone link me to it, btw?
 
@Xeo ah fuck it, the standard is unMarkDownable.
 
@Pawnguy7 Mostly, yes.
 
7:28 PM
@R.MartinhoFernandes And the break break break idea a few weeks ago just made me laugh xD
 
@rubenvb Wait, how would that work? I don't see any constants other than the characters themselves.
 
Isn't static if a compile time equivalent to #if?
 
@Morwenn Yeah, that's the kind of crap I am talking about. It's hilarious, but...
 
what do you guys reckon is the "most beautiful" way of creating a tuple of N elements all of type T?
 
@Mysticial 1-0, a-A are all ASCII ranges.
 
Xeo
7:29 PM
@rubenvb Why do you think it's about moving ownership and changing deleter?
 
@EtiennedeMartel Nope, it actually knows about the language.
 
@refp std::array<T, N>. Even std::get<I> works.
 
@R.MartinhoFernandes Pompopom.
 
@Xeo that was wrong, but I still don't see what those do.
 
Xeo
Allow you to pass a deleter?
 
7:30 PM
isn't that the template parameter's job?
 
@R.MartinhoFernandes To what, the free-for-all pointer conversions, or the anti-static-if paper?
 
Xeo
std::unique_ptr<T,D>(p, d)
 
@rubenvb That helps?
 
Xeo
@rubenvb And what about deleters with state, function pointers?
 
@DeadMG anti-static-if
 
7:30 PM
They aren't exactly in order.
 
@Xeo hmm, ok. I see.
 
@R.MartinhoFernandes Do you know the doc number?
 
@JerryCoffin "mostly"?
 
Xeo
@R.MartinhoFernandes @DeadMG ^
 
7:32 PM
@refp As a curiosity you could do std::make_tuple<Decay<CommonType<T...>>...> make_stupid_tuple(T&&...);
 
Xeo
lol
 
@R.MartinhoFernandes I'm pretty sure I just implemented the perfect dice throwing function, but my test data suggests otherwise :)
1: 491796863
2: 33750
3: 4197607
4: 1014
5: 1010
6: 995
 
Some parts of the anti-static-if paper sounded like troll whatsoever. The one about how hard it is to CTRL+F for static if for example.
The same could have been said about enum class.
 
@FredOverflow lol, can I see it?
 
@rubenvb With that logic, then why pass an element to the unique pointer constructor? There's already a template parameter for it! :)
 
7:33 PM
@R.MartinhoFernandes Oh wait, it was the test itself that was broken. I used an uninitialized array for counting :)
1: 1031
2: 983
3: 967
4: 1014
5: 1010
6: 995
 
@R.MartinhoFernandes but heck, it isn't a std::tuple<...>!
 
@Morwenn Wait, it is hard to grep for static if?
 
@LucDanton yeah, bad logic. Punish me.
 
Read the paper, you'll see.
 
@refp Can't tell them apart.
 
7:33 PM
@refp It behaves like one in almost all respects.
std::tuple_cat is the only place where you might be able to tell a difference, and even then it depends on the implementation.
@Morwenn I will. I need to go shopping before stuff closes now.
Later.
 
I'm not actually going to use this imaginary scenario, I just thought about it for a sec
 
Xeo
@R.MartinhoFernandes I wish stuff was open till 10pm here. :(
 
gonna write an example implementation that I have in my head, but it's quite ugly
 
@R.MartinhoFernandes Haha, you better go fast then.
 
@Xeo Oh. Nearest Rewe is open until 24. :P And still walking distance.
 
7:35 PM
@Pawnguy7 The actual generator you use isn't specified, but a few things like a minimum of a 15-bit range are required.
 
Xeo
@R.MartinhoFernandes I had that too, 10min walk to a Kaiser's that was open till midnight
But not out here :s
The best I have is a Lidl which is open till 9
 
@JerryCoffin So, it defines, for example, the range, but it might be extremely great or extremely crappy depending on implementation?
 
@R.MartinhoFernandes Here's the code. I don't see any significant difference :( Any room for improvement?
 
Xeo
@refp: There's a really easy way to convert a std::array to a tuple, though
 
Reopen-queue audits are funny.
 
7:38 PM
@Morwenn The difference is that there is little reason to grep for enum class, whereas there may well be lots of reason to grep for static if.
 
^ most be possible to do it in a more estetic way than above?
 
@Xeo what's the type of A in that quote? Is it just remove_reference<remove_cv<D>>?
 
@DeadMG Couldn't they introduce something like "undividable spaces" ro resolve that? Multi-word operators?
Just joking.
 
Xeo
@rubenvb "If D is a ... type A..."
 
so I take that as a yes?
 
Xeo
7:40 PM
It's defined per case
For one it's a non-reference, for another it's an lvalue reference A&...
 
nono
A is always the "pure" type of D, no?
ie, remove_cv<remove_reference<D>>
otherwise I can't make sense of that.
 
@Morwenn Might as well just grep for enum, the two are enumerations anyway. Not so much with static if though.
 
Xeo
Ah, yeah. It's basically pattern-matching {auto, auto&, auto const&} = D
 
And now for Update 2.
 
@LucDanton Grep for static then. Or just don't write silly code :p
 
Xeo
7:42 PM
@Morwenn I dare you make others note write silly code.
 
@Xeo yeah. I thought enable_if should be able to cut it? Or is there a simpler way out?
 
@Xeo They should pay for they own mistakes.
 
@Morwenn static has other meanings :|
 
Xeo
@Morwenn And you'll pay for them too.
 
what does nothrow do?
 
7:43 PM
@Pawnguy7 you mean noexcept.
 
@Xeo That's ok, I only write my production code in Python.
 
Oh. Yes.
 
Xeo
@rubenvb That and maybe a transform on D to keep the number of overloads lower.
@refp std::tuple_size<std::array<int,10>>::value == 10!
 
@Xeo hmm. I've typedef'ed an A and have 6 overloads. I guess 4 would do if I rewrote the conditions?
 
Xeo
I think 3 is possible
but that might get messy
 
7:46 PM
Don't the functions pretty much all do the same thing (except for static_asserts)?
 
Xeo
You can combine the rvalue ones that cause the program to be ill-formed definitly.
Hm, true, 2 should also be possible.
Lemme think
 
wow, wtf.
 
I'm getting sleepy. See you later.
 
this part could really have been structured better.
the requirements part needs to be puzzled into the previous 3 points.
 
@Pawnguy7 It defines the minimum range, but it can be anything larger than that. And yes, it can be anywhere from lousy to great. I should probably add one more tidbit: the C89/90 standard included a pretty lousy sample generator -- but with wording that made some think that was the mandatory implementation.
 
7:50 PM
I'm guessing conditional could help reduce the # of overloads
Well anyways. I'm outta here
 
@Xeo sure, but it's more of a theoretic question on how to do what has been done in a more clean manner, if there is any?
 
Xeo
unique_ptr(T*, If<std::is_reference<D>, D, D const>&){}

unique_ptr(T*, D&&){
    static_assert(!std::is_reference<D>(), "...");
}
I wonder if the above would be enough (for the signatures). /cc @rubenvb
@refp Sure, indices.
 
@FredOverflow >= safe_bound means you accept safe_bound+1 different values. For starters.
 
@R.MartinhoFernandes What? No, I don't. The number of values that are not >= n is n. For example, there are 1000 numbers that are not >= 1000.
 
@Morwenn Grep for static if?
@FredOverflow 0 is a valid return value from rand().
 
7:57 PM
Yes, and the numbers from 0 to 999 are 1000 numbers.
 
But 1000 >= 1000 too.
 
Yes, but 1000 is not accepted.
 
Because 1000 >= 1000 is true, so the loop will continue.
 
It isn't false...
Oh, you are right.
Sorry.
Well, anyway, what you are doing is discarding all the entropy of those values outside the range. If you discard the entropy, you cannot expect the results to be uniform, even assuming rand() is uniform.
 
7:59 PM
I guess my compiler's rand is too good to reveal any significant differences between mod6 and other approaches.
@R.MartinhoFernandes Oh, should I accumulate those somehow? Sounds interesting.
 
I honestly don't know what the totally correct approach is, but someone once linked to an article with all the gritty details.
 

« first day (920 days earlier)      last day (4034 days later) »