« first day (1569 days earlier)      last day (3365 days later) » 

12:01 AM
I think the Windows shell does that too, since some versions ago. (I'm guessing you're on Windows because you'd have no reason to use putty otherwise)
 
Right @Wintermute
I think your avatar is cool @Wintermute
 
If it doesn't work you'll need to fix it. — Columbo 14 secs ago
 
Thank you. I had no hand in making it.
 
user1804599
Does Boost have a map type that keeps the order of insertion?
 
12:17 AM
The multi-index stuff could be abused for that, I think.
 
Xeo
@thecoshman Btw, $5mil
 
user1804599
can you like forward-declare a typedef
 
user1804599
class A; using A = boost::variant<T>; doesn't werk.
 
Xeo
nope
 
user1804599
fuck
 
Xeo
12:22 AM
you can do struct A; struct A : boost::variant<T>{ using boost::variant<T>::variant; };, though!
or however the correct way was
 
user1804599
Yeah thought of that. :P
 
@рытфолд No, but what would you need that for
 
That has some potentially unwanted side effects, though. void foo(A const &); boost::variant<T> v; foo(v); will make a copy.
 
Xeo
@Columbo to... forward declare that a type exists, without pulling in the dependencies (headers)
Just like any other forward declaration
 
Could you not #include <boost/variant/variant_fwd.hpp> and typedef right away?
 
Xeo
12:28 AM
@Wintermute It won't
 
@Xeo You can't bind a boost::variant<T> to a reference to A in that case because A is not boost::variant<T> but a child class of it.
 
Xeo
@рытфолд What kinda map is that? A wrapper over vector<pair<...>>?
@Wintermute So? It won't make a copy, unlike you claimed.
 
user1804599
Yeah.
 
user1804599
But I'll just use std::vector and a wrapper around std::find_if.
 
It will make a temporary that holds a copy as base object.
 
Xeo
12:30 AM
it won't, as I just showed.
you'll get a compiler error
 
user1804599
Eiffel has ARRAYED_TABLE[K, V]. :P
 
Xeo
Alright, time for sleeps
 
Hahaha wat
 
user1804599
Bye.
 
Oh, you're right. I thought it would pull in the ctor from variant. with that using.
 
Xeo
12:35 AM
non-special ones
IIRC
 
Apparently so. I'll better go look up the precise rules.
 
user1804599
@Xeo breaks implicit conversion :(
 
@Xeo [class.inhctor]/3 "For each non-template constructor in the candidate set of inherited constructors other than a constructor having no parameters or a copy/move constructor having a single parameter, a consttructor is implicitly declared with the same (...)" Soo...essentially yes, non-special ones only.
 
@Wintermute A constructor with two parameters both having default arguments is a default constructor (and special).
Ahh, your quote is incomplete.
 
@Columbo Those are in the candidate set as per [class.inhctor]/1
If I read that correctly.
 
12:49 AM
@Wintermute The end of your quote says "[…] unless […] the constructor would be a default, copy, or move constructor for that class."
So even if it is inside the candidate set it's not declared.
 
Ugh docs
700 words and still says almost nothing
 
@ScottW Hi
 
@CatPlusPlus Oh.. did I write it?
 
@Columbo Not in C++11, interestingly. That must be new in C++14 (assuming you're reading from that).
 
I'm writing it RIGHT NOW
 
12:50 AM
@Wintermute I'm using N4140 (by default atm), so yeah.
 
I usually refer to n3290.
 
user1804599
wat
 
@Wintermute ... C++11 is outdated.
5
 
user1804599
you can't have a label following a return statement in Lua
 
@Wintermute In that case the section was defected because of what I mentioned.
 
12:51 AM
@CatPlusPlus WRITE ON, BRO..
 
I'm righting it write now.
 
Anyway
19 mins ago, by Xeo
Alright, time for sleeps
 
@Columbo That is true, but having to work with MSVC, looking things up in C++14 often doesn't help me do things.
 
@Wintermute :D
 
@рытфолд ?? a label sorta floating about in limbo?
 
12:52 AM
Sometimes looking things up in C++11 doesn't help me either, come to that.
 
IIRC VC++ doesn't even correctly implement C++11 yet
Or C++03
 
MSVC is...broken in interesting ways, that is true. C++03 mostly works, though.
I had some fun with anonymous inner structs, where MSVC didn't feel the need to honour my initializers.
 
@Wintermute A while ago I answered a question in which VC++ was showing behavior that was conforming with C++98 but not 03
And that wasn't even a corner-case or sth.
 
C++11, C++03 don't yet correctly implement VC++
 
i have a function that returns a string after doing some DB processing. how to handle the null return value if the DB processing is not found
 
12:54 AM
@Osadellah Err... check it for null?
Raise an exception?
 
@Osadellah Throw std::bad_alloc
 
tnx
 
@Columbo Do you remember what it was? I was under the impression that most changes from C++98 to C++03 were corner cases.
 
user1804599
@MartinJames labels that are targets for goto statements
 
@Wintermute Something to do with value initialization/default initialization.
12
Q: Does a default constructor always initialize all members?

MehrdadI could swear I don't remember having seen this before, and I'm having trouble believing my eyes: Does an implicitly-defined default constructor for a non-aggregate class initialize its members or no? In Visual C++, when I run this innocent-looking code... #include <string> struct S { int a; s...

 
user1804599
 
user1804599
Oh wait.
 
user1804599
Return statement must be the last statement in a block. What the fuck.
 
Ell
1:10 AM
@рытфолд I'm confused. Why would you wNt to forward declare this?
 
@Columbo Interesting. I don't think I've ever invoked that behaviour, but I can both see it as surprising for the programmer and flowing naturally from the compiler's point of view.
 
@рытфолд If they're after a return, they're a road to nowhere..
 
user1804599
 
@Columbo Being fair, nobody (except possibly Comeau) implemented C++03 completely.
 
@JerryCoffin lol
 
> As you can see, I've reduced the code by a third. I've documented the fact that it's only safe for use from a single thread.

Asio is gone. Lexical cast is gone. Things have meaningful names. No more memory order fiddling. No more thread affinity fiddling. No more inline envy. No more tedious string allocations.
I love deleting code
 
@Columbo Nobody implements C++03, except Comeau. Export templates, anyone?
 
@EtiennedeMartel You're late, mate.
 
Of course I am.
 
14 mins ago, by Jerry Coffin
@Columbo Being fair, nobody (except possibly Comeau) implemented C++03 completely.
 
1:30 AM
Especially that mess of low-level wanking that was likely just getting the way and even breaking the correctness :[
@InnocentBystander Just to be constructive as well, I've added my idea of what constitutes a much simpler start: Live On Coliru - _(I'm pretty certain is more efficient to boot, OP) — sehe 1 min ago
 
Me and Jerry think alike.
Because we're secretly the same person.
 
Ben & Jerry
 
@sehe ... is really nice, don't you think
I like ice
 
ICE
ICE
BABY
 
The only good bit about that song (the bass line) was actually sampled. So Vanilla Ice really never did anything decent in his music career.
 
1:34 AM
... because sampling isn't decent
 
Ell
What's wrong with sampling? O.o
 
@EtiennedeMartel The question is whether the evil alter-ego is the one who loves beer, or the one who doesn't.
 
@sehe I mean, he never created anything decent.
 
I don't follow. I don't think I know the song, but I don't care much about that. Seems a bit overzealous to nivellate a wellknown artist like that :/
 
nivellate ?
 
1:37 AM
May 13 '13 at 21:33, by user142019
Polar beer FTFY.
@JerryCoffin erm. well. yeah. maybe... crush? floor? void? nullify? idunno ETOOTIRED
Jan 7 '11 at 22:24, by James McNellis
Is it beer-o-clock yet?
And with that, I'm aleavin'
Night all
 
@sehe I guess it is pretty late, isn't it. Good night.
 
user1804599
Yay I implemented phi instructions.
 
user1804599
In a crappy way. But they work!
 
Why would anyone use std::is_sorted?
I can't really find a case for it for some reason.
 
user1804599
For implementing bogosort.
 
user1804599
1:52 AM
For validating user input which must be sorted.
 
user1804599
For algorithms that can be optimised for sorted inputs, but are dependent on the order of the input.
 
lol
 
user1804599
So I implemented phi instructions nicely. Every jump sets a local variable to the block name, and the phi instruction looks up the block name in a table to find the corresponding value. :D
 
std::is_sorted is linear in time complexity, right?
Can log(n) be considered constant time?
 
user1804599
I don't see why std::log wouldn't be considered O(1).
 
1:59 AM
Like, it goes up to 27 for n = 100000000.
Yes, it grows with the input, but it's very very low.
I would assume that for many practical applications log(n) could be considered just as computationally expensive as constant time.
 
user1804599
I wanted to make a joke about your mother's mass, but then I realised we were talking about O(log n), not O(2^n).
 
user1804599
36
Q: O(log N) == O(1) - Why not?

phokuWhenever I consider algorithms/data structures I tend to replace the log(N) parts by constants. Oh, I know log(N) diverges - but does it matter in real world applications? log(infinity) < 100 for all practical purposes. I am really curious for real world examples where this doesn't hold. ...

 
user1804599
> What good is an O(log2(n)) algorithm if those operations cause page faults and slow disk operations? For most relevant datasets an O(n) or even an O(n^2) algorithm, which avoids page faults, will run circles around it.
 
user1804599
@FredOverflow MongoDB will run circles around MySQL.
 
dat log2
AFAIK log is always base 2 in the computer science context
 
user1804599
2:08 AM
No. Always be precise.
 
user1804599
One should always add the base explicitly.
 
You are clear.
Only sith deal in absolutes.
 
FUCKKKKKKKKKKK I can't watch the mythbusters episode on video games because my cable provider doesnt have Discovery US
 
There's not always an "always".
 
user1804599
The generated code is beautiful: gist.github.com/rightfold/3d0c734e7a56b18e4d6e
 
2:09 AM
Your mum is beautiful.
wtf, and you consider that beautiful?
 
user1804599
Of course.
 
local i8
local i9
local i6
local i7
local i4
local i5
local i2
local i3
local i1
the heck
 
user1804599
If I leave that out it'll make them globals.
 
make a motherfucking array
 
user1804599
No.
 
user1804599
2:11 AM
This is much easier.
 
also what's going on with all them gotos
 
user1804599
That's jumps between blocks.
 
I've just doubled the amount of gotos I've seen in my entired life
 
so whats the lounge doing tonight?
 
2:24 AM
@Mikhail Obligatory "Your mom" joke.
 
What the fuck is going on
waaat
Why am I receiving other people's mail?
lol
 
@Jefffrey Other people's mail? OPM? I though that opium was illegal.
 
Two italian people have been fighting via email and I'm receiveing their mails.
I have no idea why. I'm not listed in the to or from or cc list of their email.
In doubts I've changed my password and setup 2-factor auth, but this is hilarious
The first message I received was like: "Why am I getting your emails?" and then the other replied "Fuck you!" (in italian of course).
And I was like: "waaaat"
 
3:00 AM
@orlp So I'm playing around with the newest Intel compiler. It's smart enough to combine stuff like (x |= a & MASK) into x = vpternlogd x, a, MASK, imm.
I'm impressed.
That was an optimization that I was planning on doing manually. I guess I won't need to.
 
@Mysticial No other compiled did that before?
 
@Borgleader Nope. vpternlog is an AVX512 instruction. Only ICC and GCC supports it right now.
I don't know if GCC does this optimization. I never tested it, and they say they only have "basic" AVX512 optimization in place.
 
Being a compiler dev must be hard as hell.
 
Granted, this isn't a very difficult optimization to do. You could take any combination of 3 variables going into 2 bitwise logic instructions.
 
Nah.
I don't mean that optimisation.
I mean in general.
 
3:08 AM
well yeah.
 
Supporting all these different instruction sets and what not.
Sounds difficult.
 
it might be an easily separable task?
 
There are some people on SO (mainly older people I've noticed) that insult compilers and say they're really bad so they tend to do almost every optimisation by hand.
That's what I've noticed while perusing and what not.
 
Here's a small snippet of AVX2 code recompiled with AVX512-DQ:
vpandd    ymm10, ymm16, ymm14                           ;65.5
vpsllq    ymm16, ymm24, 39                              ;65.5
vpsrlq    ymm11, ymm26, 24                              ;65.5
vpternlogd ymm10, ymm12, ymm15, 248                     ;65.5
vpternlogd ymm10, ymm16, ymm14, 248                     ;65.5
That thing would be at least 7 instructions under AVX2.
 
Here is what I don't get, if the CPU runs an AVX256 instruction does it ignore half the AVX512 register? Like if it gets an FMA?
 
3:14 AM
@Mikhail It ignores the upper half for all inputs. The output sets the upper half to zero.
This is the case for all VEX and EVEX encoded instructions.
For SSE, it leaves the upper half unchanged.
 
@Mysticial Sounds awful, I would expect the hardware to automatically group them, so that you use 100% of the CPU rather than 50%. Why?
 
There's a bit of story to that.
 
I think alignment might be a problem, but thats about all...
 
Zeroing registers is basically free.
 
But its wasting 50% of my CPU!
 
3:17 AM
When you issue an instruction that only touches the bottom part of a register, it goes though the same pipeline as the full instruction. But the upper execution units are simply turned off.
And by "turned off", I mean no transistors flipping. No power consumption.
 
Yeah, I'm pissed off about that. I expect it to run 2 AVX256 in batch automatically! The siliconis there, why is it being wasted
 
@Mikhail Yeah, that's not how the pipeline works.
 
But why!
!!!
 
The bottleneck in execution is not the number of execution units, is the number of instructions.
Right now, we're basically topped off at 2 - 4 uops/cycle. With that limit, the other way to increase performance is to make each instruction wider.
There's so much real estate on the chips, that Intel is basically making everything wider and saying, "I have all this area, here's some wider units. I know few people will be able to use, but plus-points to those who can." - lol
IOW, turning dual-issue AVX512 into quad-issue AVX2 is not feasible. If it was, they would've done quad-issue AVX2 in the first place instead of making AVX512 in the first place.
 
@Mysticial But I think this is because of pipeline is good at overlapping computation so that feeding the beaste is the limit. BUT, why can't the pipeline see a AVX256 FMA and convert it to the AVX512 version?
 
3:24 AM
@Mikhail What do you mean by "convert a 256-bit FMA into a 512-bit FMA"?
Did you mean, "take two 256-bit FMAs and combine it into a 512-bit FMA"?
 
@Mysticial Yep
 
@Mikhail Then you have to put 2 instructions through the instruction pipeline.
Like I said, the bottleneck is not the number of execution units. It's the number of instructions you can issue per cycle.
If you're stuck at 2 - 4 IPC, then you might as well make them as wide as you possibly can for those who can utilize it.
@Mikhail Btw, compilers can do it. But not the processor.
Oh this is cool:
 
@Mysticial I see, I guess the real moral of the story is that we need a binary transformation tool that detects these instructions and fixes them
 
Auto-vectorized with AVX512. No loop peeling needed thanks to masks:
 
maybe put it it into the OS
 
3:29 AM
.B49.25::                       ; Preds .B49.25 .B49.24
    vpmullq   zmm7, zmm5, zmm4                              ;199.5
    add       r14, 8                                        ;199.5
    vpaddq    zmm5, zmm5, zmm1                              ;199.5
    vpcmpuq   k1, zmm6, zmm3, 2                             ;199.5
    vpmullq   zmm16, zmm7, zmm4                             ;199.5
    vpaddq    zmm6, zmm6, zmm0                              ;199.5
    vpaddq    zmm4, zmm4, zmm0                              ;199.5
 
cat povray | fix_fma >& faster_povray
 
@Mikhail It's the same thing as auto-vectorization. But now you're trying to vectorize pairs of 256-bit vectors into 512-bit vectors.
I also see some auto-generated conflict-detection instructions used to vectorize something with indirect addressing...
Though I have no idea what the fuck the compiler is doing here:
    vpconflictd zmm20{k1}{z}, zmm1                          ;374.9
    vpgatherdq zmm21{k4}, QWORD PTR [768+rdi+ymm1*8]        ;374.9
    vpaddq    zmm22, zmm21, zmm2                            ;374.9
    vpblendmq zmm21{k2}, zmm21, zmm22                       ;374.9
    vpandd    zmm20, zmm20, zmm0                            ;374.9
    vshuff32x4 zmm19, zmm20, zmm20, 238                     ;374.9
    vptestmd  k0{k2}, ymm20, ymm3                           ;374.9
    kmovw     r15d, k0                                      ;374.9
 
@JerryCoffin Did you think that up on the spot? Impressive.
 
3:54 AM
@Jefffrey There's this thing we call BCC
 
4:47 AM
My hand hurts, we should outsource /dev/random through Amazon Mechanical Turk.
 
5:45 AM
m_timerinfo->asio_timer.async_wait(
	TimeoutHandler(std::move(m_timerinfo)));
can anyone spot the stupid? :p
(i wasted an hour on this)
 
@Pris Hmmm..the combination of m_timerinfo-> and std::move(m_timerinfo) doesn't look like a good plan.
 
6:01 AM
yeah. std::move(m_timerinfo) will set m_timerinfo to null... and that happens before the outer part of the statement where asio_timer is called
 
6:13 AM
Hmm... So I'm playing with Intel's CPU emulator right now. And it looks like they leaked the exact set of instructions that Skylake and Cannonlake will have.
That said, I don't think it's entirely accurate and they are free to change it.
 
Hm..
I should work on lazy evaluation.
but then I think of all these expression templates
might not be too bad since I only have to overload one operator
 
@jalf ^ Viper!
 
6:36 AM
why does codeproject appear in the first page of my google results
that site is so bad
 
7:05 AM
Alright. Looks like y-cruncher v0.6.8 compiled for Skylake with AVX512 works under Intel's emulator. Albeit 200x slower than the native AVX2 binary. Whatever, it works.
So whenever the hell this processor hits the shelves, I'm gonna see if I can be one of the first people to put up an app that uses AVX512.
 
Fancy?
 
Kinda. I was one of the first to support AVX when Sandy Bridge came out. It took 1 month from retail to when I released a version with AVX.
And 3 of the weeks during that 1 month was waiting for Windows 7 SP1.
The last week was mostly testing and plugging up holes.
Since I had already been building support for AVX a year before Sandy Bridge was release.
I'm doing the same thing for AVX512 now.
This time, I'm actually using Intel's emulator and not some compile-time shit that I put together myself.
 
I'm messing with expression templates to see how to design this thing.
I want to lazily evaluate functions.
So.. something like x | f | g | h
For some reason it was easier when I dealt with mathematical operations.
I guess a starting point would be x | f | g | h -> h(g(f(x))) but that gets tricky when dealing with multiple parameters I think
 
My usual advice is to leave syntax for last, starting with semantics. lazy(h)(lazy(g)(lazy(f)(x)))) is ugly but you can focus on the essential machinery, no?
 
I picked that syntax as an example.
But yeah you're right
The syntax is irrelevant.
 
7:16 AM
And whether you start with call(lazy(f), x, y) or lazy(f)(x, y), there is no issue with the number of parameters.
 
In this case the parameters will only store things like predicates.
So in a way it's just state for the functor.
So in a way there is actually no multiple parameters.
Just different ways to construct objects.
Hmm..
Well.. biggest problem I think is return values.
lol
Expression template wise I guess the above would be equivalent to expression<expression<expression<x, f>, g>, h>.
but RETURN VALUES.
 
Looking for something like eval(lazy_expr) that ends the laziness perhaps?
 
I meant the return value of an expression.
What if it varies.. What should be? Hell. I don't know.
Would it even an issue with C++11 and decltype + auto?
 
I don’t know what the problem is.
 
expression<x, f> has to return something that allows it to be used with expression<??, g> etc etc.
 
7:26 AM
Please clarify. 'Return' in particular.
 
I think the fact that you don't get it means that my issue is probably non-existent or probably overthought.
 
Quack, quack.
 
?
 
Oh.
I'm still kind of lost.
 
7:30 AM
Regarding rubber ducks?
 
No my problem.
 
What does it mean for an expression to return something?
 
decltype(f())
 
Function call then?
 
I think this is some sort of dramatic irony
Because I have more details in my mind about the domain of the problem than you.
My fault.
 
7:31 AM
Eh, I don’t mind being a rubber duck.
 
A more (realistic) example of what I'm trying to do is things like from(container) /* turn to functor */ | filter(predicate_here) | map(aggregate_here); and have that return a 'generator'.
 
What is the semantics of expr(), for a lazy expr?
 
So I was thinking about that idiocy with iterators and what not
and containers
and what a pain it would be overall
 
Can always go with collect<Cont>(gen).
Which internally does the Cont cont { workaround_iter(gen), {} }; thing, is my point
 
I'm still thinking about what from(x) | filter(y) returns.
I'M A BIT SLOW
 
7:35 AM
Ditch the syntax, go for functionality first :)
 
:( the syntax is irrelevant
it could be filter(y, from(x))
 
What does from perform?
 
it still returns something to compose to other things
@LucDanton Converts the container into functor w/ container. So when you call it you get the container back.
that way when you get to the bottom of the expression chain it meets the interface I guess.
So.. expression<x, f> would do f(x()).
 
I think you’re being lazy in two domains. Regular arguments (e.g. containers) as well as container/range elements. Make sure you don’t mix up the two.
 
This problem was fucked from the get-go.
 
7:49 AM
@Rapptz I kinda have an example sitting around, but I’m hesitant to show it—I don’t want to rob you of the experience of figuring out things on your own.
 
8:05 AM
--> Spawning /usr/sbin/local/start
Good job, me
 
8:23 AM
@LucDanton I guess I'll work on it.
I went to eat and what not.
I'll let you know if I suck at it.
 
Just use your fingers.
 
Good advice.
I think I have it figured out
 
Scarf down on it really.
3 mins ago, by Rapptz
I'll let you know if I suck at it.
 
Yeah I got the joke dw.
:p
 
9:12 AM
hey luc
how's your range stuff going?
 
@CatPlusPlus Wrong --prefix?
 
@Puppy I’m seriously considering inserting a position-based bidirectional concept in between double-ended ranges and random-access. Which would in turn mean that RA is position-based, so I think I should start there. Reintroducing positions is kinda weird though, so I’m biding my time.
 
Something like this?
well honestly it's pretty lame what I've written
it's just function composition
back to the drawing board
 
@Rapptz I do have a pipe for reverse function composition, yes. It’s variadic but that’s a detail.
 
9:19 AM
the general idea is the same anyway
 
@LucDanton Actually, I have a kinda burning need for some ranges in the Wide compiler, and I'm shopping around. Wide ranges don't port that easily to C++, unfortunately
 
@Rapptz It’s funny, the example I could have showed you does have reverse composition. But I would have added a disclaimer that it’s not really lazy eval, but an example of how you can tack on a syntax-ish veneer to an underlying functionality.
 
this is lazy though isn't it?
I can't see how it isn't
 
@Puppy Big sticking point is that historically speaking Clang has not been kind to my programs. It’s been a while though.
 
don't need it, at least not imminently
 
9:23 AM
Look at Niebler ranges.
Unless you already did and didn't like them.
 
I use G++ on Linux and MSVC on Windows and then at compiler run-time for Wide, I can use Wide ranges.
@Rapptz Not a huge fan. The guy made loads of random restrictions in the name of hypothetical performance.
 
I haven't really used it.
 
IMO his core idea of begin() and end() not being the same type is pretty solid
but on top of that he's built something almost as annoying as iterators from what I can tell
 
@Puppy The other bit being that bidi (meaning double-ended + saveable, since it’s not its own concept) and RA are fucking weird if you start thinking about it.
I do like composing/building single-ended/double-ended ranges with it though.
 
@LucDanton Right now I only need a few basic features- create range from initializer list, create range from container, concat range, map range, forward ranges only, and also type-erased range.
 
9:27 AM
Yeah that’s the kind of stuff that’s fun to do already.
No range-for support by principle btw.
 
okeydokey
 
9:40 AM
Well.. it works I guess.
I can't help but feel like it's terrible though. :(
I don't know why I think this is terrible. Something is missing.
 
9:58 AM
@sbi Questions and answers should be upvoted and downvoted based on whether they are good or bad, not based on whether we like the OP or not, or based on actions the OP has taken elsewhere ("downvote the post, not the person"). Discouraging unwanted behavior by adopting even more unwanted behavior (because it affects the whole SO) is not only "aggression", it is overreaction; and it should not be defended because, as you say, nobody endorses it.
 

« first day (1569 days earlier)      last day (3365 days later) »