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

19:00
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.
19:03
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.
19:06
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
Xeo
@R.MartinhoFernandes I just saw that
@R.MartinhoFernandes He obviously wants an initializer list, d'uh.
19:09
So, I need to reboot for VS2012.
See you guys in a few minutes.
Xeo
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?
19:11
@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.
19:13
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/…
19:14
@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.
19:16
@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.
19:17
@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.
19:17
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
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
Xeo
And std::mt19937 looks cool too :)
19:18
@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
Xeo
@EtiennedeMartel SuppressUppercaseConversion <3
@R.MartinhoFernandes ...except for efficiency ;-)
rand() % 6? Nope.
19:19
@R.MartinhoFernandes Jesus saves, everyone else takes rand() % 11 + 1 damage.
Xeo
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
Xeo
Maybe people just don't want it...
19:20
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
Xeo
That reminds me, I wanted to fix the [](<operator>) syntax part
@DeadMG *its
whatever
19:21
@JerryCoffin Yeah, it could be built around <random>!
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.
19:22
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)
19:24
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
Xeo
19:25
@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
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.
19:27
@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.
19:28
@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
Xeo
19:29
@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
Xeo
Allow you to pass a deleter?
19:30
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
Xeo
std::unique_ptr<T,D>(p, d)
@rubenvb That helps?
Xeo
Xeo
@rubenvb And what about deleters with state, function pointers?
@DeadMG anti-static-if
19:30
They aren't exactly in order.
@Xeo hmm, ok. I see.
@R.MartinhoFernandes Do you know the doc number?
@JerryCoffin "mostly"?
Xeo
Xeo
@R.MartinhoFernandes @DeadMG ^
19:32
@refp As a curiosity you could do std::make_tuple<Decay<CommonType<T...>>...> make_stupid_tuple(T&&...);
Xeo
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! :)
19:33
@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.
19:33
@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
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.
19:35
@Pawnguy7 The actual generator you use isn't specified, but a few things like a minimum of a 15-bit range are required.
Xeo
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
Xeo
@refp: There's a really easy way to convert a std::array to a tuple, though
Reopen-queue audits are funny.
19:38
@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
Xeo
@rubenvb "If D is a ... type A..."
so I take that as a yes?
Xeo
Xeo
19:40
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
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
Xeo
19:42
@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
Xeo
@Morwenn And you'll pay for them too.
what does nothrow do?
19:43
@Pawnguy7 you mean noexcept.
@Xeo That's ok, I only write my production code in Python.
Oh. Yes.
Xeo
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
Xeo
I think 3 is possible
but that might get messy
19:46
Don't the functions pretty much all do the same thing (except for static_asserts)?
Xeo
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.
19:50
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
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().
19:57
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.
19:59
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 (4254 days later) »