« first day (1058 days earlier)      last day (3907 days later) » 

8:00 PM
@melak47 Why are you taking universal references if you're not using perfect forwarding?
 
@FredOverflow idk :D
 
@sehe hard response, but some people really need it
 
@melak47 You should know this, melak47.
 
@Borgleader Yup. And I'm very sorry. Like with this one: stackoverflow.com/questions/18687856/… (you answer a "noob-level" question with relevant detail, prepare to get "wronged" for failing to mention all differences between permutations of candidate data structures :/)
Common sense, people, common sense.
 
@StackedCrooked doesn't std::bind copy the arguments anyway?
 
8:01 PM
I blame educators
 
@melak47 Time to ask on stack overflow maybe?
 
@melak47 lol I don't know that shit
 
@FredOverflow but you asked me :p
 
@A.H. Me too
@melak47 unless std::ref or std::cref is used
 
@sehe that's what I thought cppreference said :D
 
Xeo
8:03 PM
@melak47 How do you call push?
 
@Xeo like so: win->eventqueue.push(win->OnClose);
 
Xeo
@melak47 Yes, but it also copies rvalues, which would be prevented if you used std::forward.
@melak47 Then please change push to take F by lvalue ref
 
@melak47 here:
template<class F, class... Args>
void push(F & fun, Args&&... args)
{
    std::lock_guard<std::recursive_mutex> lock(producer);
    back->push_back(std::bind(std::cref(fun), std::forward<Args>(args)...));
}
 
Xeo
@sehe s/F const/F/
 
@Xeo why? :o
 
Xeo
8:05 PM
@melak47 if you pass in an rvalue, you'll have a dangling ref in the queue
 
Functor needs to be const, IMO because you don't want to be running mutable functors under a lock. In fact, you don't actually want to be running user-supplied code under your lock in the first place.
 
Xeo
std::cref makes it const just fine
 
@Xeo Oh, that part
 
Xeo
I just want to prevent rvalues from being able to be passed in
And F& can still bind fine to const lvalues
 
@Xeo Nice point
 
8:06 PM
@Xeo right, I tend to forget that
 
hm..ok
 
user1804599
Dat rain.
 
@melak47 running user-defined code (F) under your lock is a nice recipe for undebuggable deadlocks. If this is a general purpose API, don't
@not-rightfold hah, it stopped here
 
Xeo
@sehe Notice how it's a recursive mutex
 
user1804599
I'm fucking confused.
 
8:08 PM
@sehe the lock is only there for putting it in the queue
 
Xeo
Actually, why is it a recursive mutex?
 
@Xeo irrelevant (slightly less risk unless other locks are involved)
 
@Xeo because WndProc calls itself recursively for some crap apparently :E
 
Xeo
@melak47 And that matters how while inside the push?
 
@melak47 The function F could go and get other locks --> boom, deadlock opportunity
 
8:09 PM
@Xeo I suppose it doesn't :)
@sehe F isn't called under that lock
 
@sehe Yeah I know what you mean. That's why I was relunctant to answer this question but I was luck and it turned out alright.
 
@melak47 irrelevant! If the lock can't be gotten, and another thread won't release it because the 'push' mutex is still held, no thread progresses
@Borgleader Actually:
Your more than right I am completely new to C++ and could do with some study I appreciate the assistance though it's been extremely helpful with making me understand and debug my code, much appreciated, sorry for any frustration. — user2757849 7 mins ago
 
o.O A grateful OP, we don't see that very often
 
@sehe I don't follow. how are F and my lock related?
 
@melak47 You tell me. I'm playing the devil's advocate here: if this is a general purpose API, don't invoke a user supplied 'callback' under any conditions.
@Borgleader However:
@Arrieta I hope novices know how to find the documentation (en.cppreference.com/w/cpp/container/map) because, that's not what SO is for (it is also not what his question asked) — sehe 1 min ago
 
8:14 PM
@sehe what do you consider general purpose?
"never invoke a user supplied callback" seems a bit harsh of a policy? :(
 
@melak47 You don't know/control all clients of the library.
@melak47 It isn't. Unless you like deadlocks
 
user1804599
Wonderful.
 
user1804599
I'm less fucking confused.
 
@sehe don't like a lot of libraries do that?
 
@not-rightfold less fucking? that's not good
 
8:16 PM
@sehe I'm still confused. my queue never calls any of the functions it stores
 
Xeo
@StackedCrooked "less fucking" might be a valid solution at times
 
hmm...
 
@melak47 Okay, I just checked, and yes even A. Williams softens the point for a situation like this: /cc @A.H.
@melak47 O shit. Disregard, wipe, truncate and clobber! I failed to notice the actual bound function was being stored (I misread it as being invoked to yield an item to push_back)
 
@sehe oh :)
 
Xeo
@sehe haha
 
8:22 PM
I suppose it might still apply though, the user could potentially pass in any F and Args of any type - with evil move/copy constructors?
 
@melak47 That's their problem. They can't expect to have locks in constructors and it not hurt. This, by definition, violates at least the SRP, IMO
 
@sehe also, actually no user is pushing back OS events...
well, not directly :)
 
@melak47 oh, then delete the code altogether, no need to keep unused code
 
Xeo
Oh gawd
 
(hint: define "user" appropriately here. Also, this is what I meant when I said "iff this is a general purpose API". It seems you want to say you do control all usages)
 
8:25 PM
Oh my god.
 
@sehe lol
 
A vector lookup in debug mode is taking up 68% of execution time in a function
 
@sehe yeah, I meant I am the only one pushing stuff there
 
The call that draws the tile is taking up 1.4% :|
 
@MohammadAliBaydoun if only all performance problems could be fixed by turning on release mode :)
 
8:26 PM
@Xeo are you in #llvm or is that a doppelganger?
 
@melak47 Then, obviously, you call the shots
 
Xeo
@Borgleader That's me all right
 
@MohammadAliBaydoun If it's a large vector.... Or, you know, if it's the function that does vector lookup (I'm surprised it's not 98% then)
@MohammadAliBaydoun ouch
 
@sehe It had a size of 65536
What kind of debug asserts do they have in there? :|
Are they computing pi to a million digits to make it look like they're doing some serious shit in there or something?
 
different question - why does pushing back a call on WM_CHAR messages break my other messages? :(
 
8:30 PM
@MohammadAliBaydoun It's SCARY
8
Q: What are SCARY iterators?

Mark GarciaI'm reading the VC11 Blog on VC11's C++11 features when I've come up to the SCARY iterators topic. What are SCARY iterators and how does this affect my C++ coding experience?

 
@MohammadAliBaydoun you call a million digits serious shit? have you met @Mysticial ? :)
 
@sehe Ah, now I finally understand what "sehe" stands for :)
 
@melak47 for reasons that you'll soon find out with more debugging/tracing
 
@melak47 Yes, I know :<
 
@FredOverflow Oh. Sorry, I forgot to send you the memo :/
 
8:31 PM
Someone call me? :)
 
@Mysticial False alarm, you can go back to anime
 
@Mysticial The branch predictor is here!
 
@sehe How did you know I was watching Anime?
:)
 
@Mysticial Playing the odds, playing the odds
31 mins ago, by sehe
Common sense, people, common sense.
 
aha
 
8:33 PM
@Mysticial Quick question, can you make full use of a CPU with just say one integer type and one floating point type? (say if C++ only had int and double) ?
 
0
A: Move semantics and virtual methods

FredOverflowYou could also provide an overload for Bar2 that takes an rvalue reference: class IFoo { public: virtual void Bar2(const std::string& s) = 0; virtual void Bar2(std::string&& s) { Bar2(s); // calls the const& overload because s is an lvalue } }; By default, the rvalue...

^ opinions?
 
user1804599
@Xeo Haha.
 
Jan 2 '12 at 21:53, by sehe
I should probably fire my current employer by now, I'm at the same company for 12+ years now and it's getting old. You know, they don't 'do' UNIX, C++, even Java (just C#, and formerly VB6/ASP etc): a microsoft shop.
^ oh look. I'm actually very actively looking to move out at the moment
 
@Borgleader Depends on what "full use" means.
But at least, you'd want a 64-bit integer.
 
Jul 6 at 12:43, by sehe
I'd go on personal title. My employer still doesn't carry C++ in it's portfolio (despite my spending ~50% of my 16 years with that company doing c++)
 
8:35 PM
*its; FTFY
 
@Mysticial I was wondering if a language with only one integer type and one floating point number type would be doomed to be slower than C++ in terms of arithmetic throughput so to speak. I realize this is a bit vague I might have to do some research and poke you later about this.
 
@minitech Thank you. I think I'll flag that message for moderator attention then. :/
 
user1804599
macrotech
 
"Macro hard, Micro soft" motto of the Microsoft AHGL SC2 team.
 
Ell
I've had a raspberry pi for a year at least and done nothing with it yet
 
8:40 PM
@Borgleader what are you going to do with chars?
and yeah it should be possible since C++ standard says sizeof(char) = 1 byte and rest <= , in your case byte is 64 bits
 
@A.H. I think you mean bytes, and bytes don't mean shit, they're just bytes.
 
@Ell You Bad Persion
 
@Borgleader yeah but how would you store it ? as as 64 bit bytes?
chars have special meaning
 
@TonyTheLion I do. But it might soon be over. I got a job offer from that company
 
user1804599
Job offers everywhere!
 
user1804599
8:44 PM
I have no experience because I can't get a job because I have no experience because I can't get a job because I have no experience because I can't get a job because I have no experience because I can't get a job because I have no experience because I can't get a job because I have no experience because I can't get a job.
 
@A.H. if you mean how am I going to store characters/codepoints. I'll refer you to this talk: nedbatchelder.com/text/unipain.html
 
@sehe What company?
 
Well. Release Mode actually made this thing orders of magnitude faster. :|
 
@sehe Wow everybody is getting a new job these days
@MohammadAliBaydoun rofl, no shit
 
Aug 28 at 11:26, by sehe
This is the company http://www.backupagent.com/
The foremost thing that attracts me is that they are based 15km away from where I live
 
user1804599
8:45 PM
Odfjell.
 
I usually expect something like a factor of 2 in the speed difference, not factors of 1000 >:O
 
@Borgleader I'm surprised myself, see above
 
This is just crazy.
 
@sehe Wait... you're considering changing jobs? Woah, how did that happen?
 
Aug 28 at 11:22, by sehe
In other news, I'm interviewing for a C++ position. Someone contacted me via Careers.SO
#whoknew
 
8:47 PM
@sehe oh nice. Well I hope you find what you're looking for.
 
@Borgleader how are you going to store a character array in memory ?
 
user1804599
 
@TonyTheLion I wasn't looking. But I was dreaming. Sometimes. During 15+ years
 
user1804599
Me on Careers. :lel:
 
@sehe Hahah :)
Dreaming is good.
I mean, as in dreaming for new things to do in the future, not daydreaming while you're supposed to be working.
 
8:48 PM
I like that they are taking me pretty seriously. And they're doing pretty nifty stuff (I'm not even sure that I can mention it - without violating confidentiality, for some parts)
 
Also, communication is crystal clear, open. They got me all my wishes, including part time hours. I dunno. It's hard to ignore this one
 
@not-rightfold Ooh, stats. Where?
 
@A.H. I'm still working on that. But the idea is to not make the same mistake as C++. In C++ you know what encoding the string is in and by default (unless you compile as unicode in MSVC) that's ascii. It should be a sandwhich type deal. During input you decode whatever you read, you deal with this blackbox of characters, and during output you encode whatever you have.
 
user1804599
 
user1804599
8:50 PM
Under "your profile".
 
Ah. I have 4 total \o/
 
@sehe Sounds really attractive indeed.
 
I got a job offer through Careers once. They asked for a résumé and I said I had no experience and nothing was said everafter.
 
user1804599
8:51 PM
@sehe More responses than inquiries? Did you respond twice to the same employer?
 
They asked for a resume here too. I ended up sending one 1 hour before my second interview ... :[ oops
@not-rightfold 5x actually
 
user1804599
lol
 
The thing with statistics: they could mean most anything
 
user1804599
I responded once; "not interested".
 
user1804599
The inquiry was in fucking German.
 
8:53 PM
Meinen Sie, auf "fickendes Deutsch"?
 
user1804599
lol this one
 
user1804599
> On Stackoverflow I have read with great interest your profile. Your background and interest in Ruby and Javascript matches very well with the experience that I am looking for.
 
I'd say providing the rvalue-ref version makes sense only if you're "sinking" the value into owned storage (in "Sean Parent" speak). And even then, taking by value is a lot more effective in the presence of many such parameters (because of the explosion of combination of rvalue-ness) — sehe 11 mins ago
@not-rightfold Nice word ordering.
 
user1804599
Was from comScore.
 
@sehe ...I get notified automatically, no need to quote your comment here ;)
 
user1804599
8:55 PM
For some reason I don't like that company.
 
@sehe You just reminded me, what the hell is a sink argument? -.-;
 
Xeo
@sehe perfect forwarding~
 
this concept of sinking, I don't get it
 
auto element = vector.back();
vector.erase(vector.begin());
return element; //does this seem like an..."odd" way to "pop()", or is it just me?
 
@Borgleader Think of std::vector<T>::push_back(T&& x);
 
8:55 PM
@FredOverflow You were solliciting debate. None came about. I was posting it with a reference to your invitation. The lounge is not a private room :/
 
Xeo
@Borgleader An argument that will be stored somewhere.
 
user1804599
Probably because they have over a thousand employees.
 
@sehe kthx
 
user1804599
I can't even imagine working in such a place.
 
@Xeo yeah, that's nice, only need to make it a template (oh, fuck, virtuals!) and add some (99 kilograms) of std::forward and also a ton of SFINAE to restrict to acceptable parameter types. No cost at all :/
@Borgleader It's more like "sinking a value".
@melak47 maybe pop_back is c++11? Wait, is that even correct?
 
8:57 PM
@sehe that's what I meant :p
return the last element, erase the first? the fuck was I thinking
 
hahahaha. you tell us.
you tell us
 
definitely wrong
Where is this code from?
 
^^
 
user1804599
newtype Stack a = Stack [a]
pop :: Stack a -> (a, Stack a)
pop (Stack [])     = error "stack underflow"
pop (Stack (x:xs)) = (x, Stack xs)
 
@Xeo So if I have struct Vec3D { float x_, y_, z_; Vec3D(float x, float y, floatz); } x/y/z are sink arguments? So, basically any argument that will end up in a member variable?
 
8:59 PM
@Borgleader or otherwise owned storage, yes (though move semantics are moot with float)
 
Yes, but move semantics doesn't help with floats.
 
user1804599
Woop woop.
 
@melak47 not a pop
 
Xeo
move semantics are foot with moat
 
not even a soda
 
user1804599
9:00 PM
@FredOverflow Use pointers to floats!
 
and suddenly the mystery of why I lose one event when there are two events was solved!
 
@not-rightfold pointers to pointers to floats
 
@melak47 trolololol. TDD / unit test much?
 
user1804599
Every language should offer built-in unit testing.
 
@sehe unit test a simple queue? what am I, a moron? :)
 
9:01 PM
I really like CATCH++ or whats its name
 
@A.H. floating pointers to indices to offsets of float
 
user1804599
@melak47 A queue is perfectly testable.
 
@sehe oooh
fancy
 
@melak47 you tell us!
 
user1804599
If you want to be confident it works, test it thoroughly.
 
9:02 PM
@sehe I'd rather not!
 
user1804599
There is no reason not to unit test it.
 
Yeah. Trust me it helps with shared memory realms :/
(kidding)
 
@sehe I'm doing JUnit tests for my algorithms class assignment =/
 
Ell
This picture makes me sad:
 
@melak47 The information is leaking. There's not privacy on the interwebs (unless of course you're disseminating dis-information)
 
user1804599
9:03 PM
Hmm.
 
@Ell It makes me happy. Someone has done a good job at making some of the 'deemed mysteries' less mysterious
 
user1804599
A D-like unit testing framework for C++ would be great (and doable).
 
@not-rightfold do it
 
user1804599
Ok.
 
user1804599
It will have a singleton.
 
Ell
9:05 PM
@sehe I guess that bit is happy :P
 
@not-rightfold Well, there you go.
yesterday, by not-rightfold
I need a fun project.
 
user1804599
Hmm.
 
@Ell Also, it's in friggin SVG! That's even happier
 
user1804599
If I have an inline function with a static in it, does that work the same as with a non-inline function?
 
Xeo
you get a quadrillion different statics from that, I think
 
9:06 PM
@not-rightfold that's... SO material. I'd say: yes (because inline is just a hint anyways)
@Xeo wouldn't it, instead, depend on the visibility of the containing function (static inline foo() as opposed to inline foo()?)
 
user1804599
@sehe inline is about ODR, isn't it?
 
why does ctrl+stuff produce these things o.O
 
@not-rightfold That's why I think it shouldn't matter.
 
Xeo
@sehe Ah, true
 
@melak47 because of ASCII subset in codepages
 
user1804599
9:07 PM
ARGRG.
 
user1804599
class register {
    // fu C++ :(
};
 
@sehe but why is ctrl+p anything
 
In other words: history
 
Holy shit 8600 fps >:o
 
inb4 math is off
 
9:09 PM
@sehe okay...and why does lucida console have funny symbols for them :D
 
@melak47 that's irrelevant. It's about the codepage, not the font (allthough the font might not have the glyphs)
 
It's my compute power and GPU speed mostly. This wouldn't run at 1000 fps on a 'normal' computer :/
 
hehe. The math's off!
 
@MohammadAliBaydoun doing what?
 
@meetingcpp Will Meeting C++ videos be posted online like GN videos?
^ I should totally bring my cam and sell the vids :/ @R.MartinhoFernandes
 
9:12 PM
hum. mouse wheel down is recognized as the backspace key...I wonder how I managed that
 
@melak47 I tried seeing what would happen if I turn off the optimization that only renders what the user can see a few weeks ago and I forgot to turn it back on (it was 'experimental' at the time because it kept bugging and I had no idea why, but it became stable at one point). I found the switch and flicked it. FPS went up quite a lot :o
 
@melak47 we're all killed by the suspense
 
TL;DR; Rendering shit
 
user1804599
Time to eat something delicious.
 
user1804599
Any suggestions?
 
user1804599
9:16 PM
inb4 ketchup-flavoured crisps
 
Xeo
Edible things.
 
Cheese.
 
@not-rightfold damn you don't give us a chance
 
Wait, good idea. I'm going to have some cheese.
 
Xeo
I had a sammich for dinner.
 
9:16 PM
Have a piece of bread with Nutella and chocolate sprinkles on the Nutella.
 
@sehe sorry, it was boring.
 
Xeo
Copy-paste error? :P
 
user1804599
Hmm.
 
user1804599
A bag of crisps.
 
I had no entry for the mouse wheel buttons in my button name map, so my code tried to find a name by converting the key code to a char, and the random enum value for wheel down happened to be the backspace key :D
 
user1804599
9:20 PM
I've never had this kind of crisps.
 
@not-rightfold you can have it after you make the unit testing thing :)
 
user1804599
They taste pretty good.
 
user1804599
Made of corn and paprica.
 
user1804599
I have a fun idea for a fun project.
 
@not-rightfold will it be named after these crisps?
 
user1804599
9:24 PM
Noo!
 
does anyone here use SourceTree?
 
Ell
@not-rightfold what is it?
Something I can run on my raspberry pi
 
@not-rightfold java.lang.Float :)
@A.H. CATCH without the ++
@not-rightfold corn + paprica = capricorn?
 
user1804599
@FredOverflow lol
 
9:31 PM
@not-rightfold well, do share
 
Good night everyone.
 
Ell
night
 
Are all GN 2013 Wednesday talks online except for Scott's? Why :-(
NW: Scott's ACCU 2011 talk about rvalue references
 
Ell
What was Scott's 2013 talk about?
 
his hair
 
9:43 PM
@FredOverflow I think they only get the ones from Day1 online before weekend happened
 
@Ell Effective C++11/14
Oh, there is another talk about universal references I wasn't aware of. Not the greatest audio quality, but acceptable:
The beginning is very similar to the GN 2013 talk. (std::move doesn't move, std::forward doesn't forward.)
 
@FredOverflow I was wondering why I was getting weird results, while unit testing I realized I made the noobest of mistakes. Integer division (for the slope)
 
user1804599
@melak47 Done!
 
@Borgleader That's why I always do this:
double dx = ...;   // note the double
double dy = ...;   // note the double
double slope = dy / dx;
 
user1804599
C++ is now D and now I can happily use it.
 
9:47 PM
@FredOverflow So why are they named that way?
 
@not-rightfold ..?
 
@not-rightfold Congratulations, you have reinvented CATCH.
 
user1804599
@FredOverflow But now I don't have to name my tests.
 
@TonyTheLion Because std::move prepares/enables a subsequent move, and std::forward prepares/enables a subsequent forward.
Of course std::move doesn't move. Where would std::move(some_object) move the object to? The garbage bin? — FredOverflow 3 hours ago
 
user1804599
And it stops after one failed test.
 
9:49 PM
@FredOverflow Heh, interesting.
 
@not-rightfold :/
BLERGH, stupid atlassian thing...the sourcetree "generate license" page is only broken for my account. created a random new account, and it works there. BAH
 
@TonyTheLion Just watch the various rvalue reference talks by Scott Meyers. Or read my longest SO answer ever ;)
 
user1804599
@FredOverflow We obviously need std::prepare_move and std::prepare_forward! File a bug report!
 
template<typename T>
typename std::remove_reference<T>::type&&
prepare_move(T&& t)
{
    return static_cast<typename std::remove_reference<T>::type&&>(t);
}
@not-rightfold You write the other one ;)
 
user1804599
lol
 
Xeo
9:52 PM
I think forward is fine
 
@FredOverflow Woah, I gotta read that sometime. :)
 
Xeo
also, s/prepare_move/as_rvalue/
 
@Xeo How is forward fine, but move is not?
 
@FredOverflow In think you mean "one of the longest answers on SO" xD
 
Xeo
@FredOverflow Because it forwards the correct value category
 
9:53 PM
anyone know if gnu free font has pile of poo ?
 
we need std::backward
 
user1804599
std::copy.
 
@A.H. gnu free font is a pile of poo :P
2
 
std::your_mum
 
@Borgleader any suggestions ?
 
user1804599
9:54 PM
std::std::aids
 
i was just making a joke -.-;
 
user1804599
@TonyTheLion Not dumb enough; too much "yo".
 
#define INTRODUCE_BETTER_NAME_FOR_MOVE(BETTER_NAME) \
template<typename T> \
typename std::remove_reference<T>::type&& \
BETTER_NAME(T&& t)
{
    return static_cast<typename std::remove_reference<T>::type&&>(t);
}

INTRODUCE_BETTER_NAME_FOR_MOVE(enable_move)
INTRODUCE_BETTER_NAME_FOR_MOVE(prepare_move)
INTRODUCE_BETTER_NAME_FOR_MOVE(cast_to_rvalue)
INTRODUCE_BETTER_NAME_FOR_MOVE(as_rvalue)
^ feel free to add to that list ;)
 
Meh, am I the only one that thinks move is still better than any of those?
 
btw does anyone else find this weird ?
 
9:56 PM
INTRODUCE_BETTER_NAME_FOR_MOVE(refref) :p
 
@melak47 allow_moves
 
Xeo
@R.MartinhoFernandes It's fine for normal uses, I guess, but it does cause confusion at times.
 
@A.H. history
 
user1804599
Time to sleep.
 
user1804599
Goodbye.
 
user1804599
9:58 PM
Have fun.
 
Ell
@not-rightfold Goodnight
 
@not-rightfold night
 
@Borgleader I don't think it's even in the top 10.
 
@A.H. why is that weird?
 

« first day (1058 days earlier)      last day (3907 days later) »