« first day (655 days earlier)      last day (4519 days later) » 

16:00
I don't think so.
say you have a stateless class that is constructed repeatedly
@FredOverflow depends on the definition of “male”.
@RadekSlupik has junk
if you only construct it once and reuse it, there will be no observable difference in the execution, right?
@FredOverflow You forgot Haskell.
it's a rule about optimizations, I think. But I'm not smart.
16:02
@FredOverflow okay. :P
@KeithLayne unless you try co compare pointers to instances.
that's what I was thinking about
@RadekSlupik Haskell is a language for the gods.
TIL: I’m God.
but if you never take the address (might be hard to prove) then you'd be safe, I think?
16:03
In the ternary operator (?:), is there a sequence point after the ??
In C and C++
@FredOverflow But still, you forgot Haskell. :)
there are no sequence points! ...anymore
@KeithLayne You have an implicit this at your hands in every member function, so...
“The rest” includes anything not C++, including god languages.
@Prætorian yes
16:04
@FredOverflow A good definition, but not good enough. There are weird things out there.
@FredOverflow but if you have no state, can you do anything with it without UB?
There's no difference really.
You have to layout the objects with space for those classes.
I think Ada as well, from what I can see.
Sadly PHP is not brave enough to block certain people like Lester Caine from the internals list. -- Nikita Popov (@ nikita_ppv)
Caught an... Interesting tweet from our vrossover PHP friend:
There's nothing you can optimize besides EBCO and exclusively TU-local stuff.
16:06
I've wondered about this before, as in what does the compiler do with all those function objects I use repeatedly in stl algorithms, whether it does some optimization there or not.
Anything else has no difference in any behaviour, observable or not, i.e., is an optimization that you can implement with a comment in the compiler's source code: // pretend nothing did this nothing that was done here.
@KeithLayne probably inlined
@sehe I need to pester you.
@KeithLayne they don't need to do anything as they don't use any storage.
@MooingDuck oh, duh. thanks.
16:07
that is, they take storage, but they don't use it.
The Cat says that everything sucks except WikiDot, Haskell and Python.
Haskell sucks like a vacuum cleaner.
@sehe I assume that you are a badass with Spirit.Lex?
@KeithLayne I think so, but you'd have to prove its address was never used outside a member function.
@KeithLayne actually, if you have no state, you can get most of that guarantee by making all the functions static I think
Yeah, might fall in the class of "impossible" or "not worth it"
16:13
I suspect you get the same optimizations as side-effects of other existing ones.
if you put somebody's @ tag multiple times in a message, will they get multi-plinked?
you could plink-bomb somebody that way.
Oh gawd, grab your goggles, quick!
@KeithLayne @KeithLayne @KeithLayne @KeithLayne @KeithLayne
0
Q: C++: create Pointertype from runtime dimension information

KaiserludiI want to do something like this: template<typename CType, unsigned int targetDimensions> struct GeneratePointerType { typedef typename GeneratePointerType<CType, targetDimensions-1>::type* type; static const unsigned int dimensions = GeneratePointerType<CType, targetDimen...

@KeithLayne @KeithLayne @KeithLayne @KeithLayne let's find out!
16:16
@KeithLayne I think not.
sound is off. Nice try, but I am immune to your weak sauce.
but the desktop notification thing is freaking out.
> This message has been edited 37 times
That’s often.
darn robots.
9 mins ago, by Keith Layne
@sehe I assume that you are a badass with Spirit.Lex?
Who. The. Fuck. Flagged. This.
16:19
OMG IT SAYS “ASS” I MUST FLAG THIS!!
It was probably @sehe because I am annoying him.
@sehe isn’t the kind of moron who flags such things.
user image
2
I know. I was subtly trying to get his attention.
@RadekSlupik Yeah, he's another kind of moron.
Oh wait, I just ruined it.
16:22
Yeah you ruined it, you moron.
:P
I like the whats-his-name hat on the kid.
Scumbag Steve
It's raining.
The sun is shining.
It y u no rain.
And I'm wearing shorts and a short-sleeved shirt.
16:24
so who just lurks in chat and flags? That's radical.
Oh awesome. I will rain today.
At 27º. >.>
omg it's freezing!
Americans. :Đ
Uh no.
26º is fucking hot.
I like how the suns look like they're drooling.
@RadekSlupik if you'd slow your roll a little, you wouldn't be such an easy target.
16:25
I do not. :<
Basically, ~82°F
The text in the widget should have a dark, one-pixel shadow.
in american™
It looks like cheapass crap right now.
So that yields super humid fun time for Radek.
16:27
@DomagojPandža 1) That's not hot
It's not?
I die @22°C
@RadekSlupik That would be very applicable SO in general.
Preferably 16-18°C for me.
℉ is just as moronic as inches, feet and pounds.
B) I can google temperatures too
16:27
@RadekSlupik My man!
82°F has been on the low end here in Michigan for the last month or so
@KeithLayne Erm, it's trivial, a factor of two and a constant offset of 32.
Had a week there where the high was ~104°F
9/5 to be exact
4) you just got trolled
16:28
The best unit for temperature is K, since it’s an SI standard.
SI needs to be System International™
Unfortunately SI is just Smart Individual for now.
But soon™.
Just like you would use J instead of kcal for energy.
@RadekSlupik K is the same unit as ºC.
@R.MartinhoFernandes ish
16:29
@R.MartinhoFernandes They are not exactly the same.
They are.
Units != scales.
Actually, they are. They differ just by a constant offset, not proportion.
That's a scale, not a unit.
@DomagojPandža aperently we're debating what "same" means :/
and since his origional comment used the word "unit", then he is correct, they are the same unit.
@DomagojPandža That looks weeeeeird. Ending a sentence with a contraction (they're).
16:33
@SamDeHaan Experimenting a bit, saw it a few times in games like Witcher. Sounds wrong, too.
The same as contracting have when its usage is possession.
I saw "all your base are belong to us" in a game once.
@DomagojPandža Huh, haven't played through that one yet. Got it in the steam sale, need to get around to it at some point.
probably not the best place to take english usage cues from.
Actually, games are quite literal.
ha, I ended that sentence with a preposition.
they really exist?
That reminds me of a classic joke.
16:36
@SamDeHaan The combat system of the first one is really annoying.
The "arrow to the knee" was warped by the community, whilst the game version is "arrow in the knee". Witcher 2 as well, except when character traits are expressed with the way he speaks.
@R.MartinhoFernandes Ah, my bad. I got Witcher 2 off the steam sale. That combat system any better?
@RadekSlupik dude you were so right flask is awesome
@SamDeHaan According to my sources (my ex-roommate, who is the only person I know that played both), yes.
@R.MartinhoFernandes I played it for 30 minutes and I agree.
16:37
My connection barely allowed me to find out there was something about me and flagging. Rest assured I won't be wasting absent bandwidth on vanities :) @KeithLayne feel free to assume I'm badass nonetheless :)
@R.MartinhoFernandes Ah, that's good.
@JustinMeiners I am always right. Except when I am not.
It is better.
@RadekSlupik And then you just recompile the Matrix to make yourself right.
But I've mostly enjoyed the adult-driven content (playing the EE right now). Not in the sense of pornish scenes, but the entire story is awesome and intricate.
16:38
@SamDeHaan I can't possibly buy "<something> 2" without buying "<something> 1", no matter how damn crapy "<something> 1" is and how damn good "<something> 2" is.
2
It just... I can't.
Hah, I understand that. I've had that issue, but I can fight it sometimes. Because I'm a cheap bastard.
So I shelled the money for both :S
Frankly, the developer (CDProjekt Red) deserves it. It takes balls to make invest oneself in making an AAA RPG title and plunging into the severe possibility of utter failure.
IIRC the first one cost less than €2 or something anyway.
I just noticed that I wrote "literal" instead of "literate". Programming is going to be the death of me.
16:41
I spent all my recreation money for July and August in sub-€10 increments. So now I won't buy any books this month :S
@sehe I was writing a lexer semantic action...the docs give the acceptable signatures, but the only free function I could get to compile was void f(). Any template parameters on a free function cause compile fail. It works fine with a functor. I think the docs are lacking there. I tried using the _start, etc. exposed by phoenix but couldn't get it right to use those as function arguments, and the function is too complex to do in a phoenix lambda I think.
Hah I spent my book budget the other week. Guess that might explain my lack of investment in games for entertainment ?
I haven't bought a book in more than a year
"Three nations have not officially adopted the International System of Units as their primary or sole system of measurement: Myanmar (Burma), Liberia, and the United States."
4
16:44
@TonyTheLion Does not surprise me :P
I still have so many to read.
That never stopped me.
@R.MartinhoFernandes I should probably budget my recreation moneys. Buuuut I have no debt right now, so it's hard.
USA ಠ_ಠ
16:44
@R.MartinhoFernandes I did mean a technical computer book
@SamDeHaan I have no debt either, but I can't not control my finances and survive.
0
Q: Class template specialization and CRTP

OlumideWould someone kindly explain why the following program does not select the specialization Bar<int> and outputs "Generic" instead of "Specialization". #include <cstdlib> #include <iostream> template<typename T> struct Bar { void doStuff() { std::cout <...

OP realized it was silly mistake. Close as too localized, please.
Argh, so many flags today.
are you like forced to process them after 10k?
Yes, in the sense that I can't not click that blue circle above my avatar. It's irresistible.
@R.MartinhoFernandes yeah that :(
in C#, 9 mins ago, by Kyle Trauberman
people come in this room for help. if they come here and encounter a wall of nothing but off topic crap
in C#, 9 mins ago, by Kyle Trauberman
they are going to go away
lol
16:55
morning
Mr @KyleTrauberman clearly hasn't been in here.
'morning, @DeadMG! And goodnight everyone, 47 hours uptime. Time to disengage.
@DomagojPandža Wuss.
@DeadMG Howdy.
gah why do none of the includes use paths?
@yurikilochek I love that.
@MooingDuck because build system.
Because pain!
@rubenvb I have to manually include some 40 folders to the include paths for the build system to build this file.
@MooingDuck My Point still stands :P
17:05
lol
excellent. They started using namespaces. So half the headers have using namespace mynamespace; in them. GAH
AAHH
@MooingDuck How can people be so dumb?
@MooingDuck Haha.
"Let's use namespaces. And while we're at it, let's use this feature that gets rid of namespaces to make it easier."
5
17:08
@R.MartinhoFernandes we need younger coders. Also to rewrite this code from scratch. Which of course, will never happen.
@MooingDuck Why younger coders?
@MooingDuck Who is we?
@RadekSlupik my company
Do you need a diploma to work there?
@n2liquid Because they're not indoctrinated.
17:10
If they use "using namespace" in headers, I guess not...
@n2liquid Because I see a lot of C or C with classes code. Though in truth, the coders probably know better but didn't have time to rewrite
@RadekSlupik yes
@MooingDuck meh
@R.MartinhoFernandes I find it funny how you changed from "dumber" to "not indoctrinated", lol; completely different things imo
@MooingDuck Ridiculous.
I am going to write a Flask-like web framework in C.
@n2liquid Well, I used "dumber" because I wanted to mean "indoctrinable". But then I realized that wasn't clear.
17:27
That troll in the C# room really is a tool.
'tool' is a really great insult. When I was in school we called this one dude 'Stanley' for years and he never picked up on it. He just thought it was his nickname.
Clang will soon have support for MS's dllexport of C++ classes.
Oh, glad you cleared that ip. The difference between tool an troll is only two letters, of course
There's a patch, but I get a compile error and I don't have the want to fix it myself.
@keithlayne I like to just add a comment // this code was generated by a tool
17:32
@KeithLayne he will hunt you down later and make you suffer for that, you know that right?
No, he still has a goofy grin on his face, I'm sure.
@KeithLayne Oh, where's that from?
Stanley Black & Decker (), formerly known as The Stanley Works, is a manufacturer of tools and household hardware and provider of security products and locks headquartered in New Britain, Connecticut. Stanley Black & Decker is the result of the merger of Stanley Works and Black & Decker on March 12, 2010. History The company was created by the 1920 merger of Stanley's Bolt Manufactory, founded by Frederick Trent Stanley in 1843, and the Stanley Rule and Level Company, founded by Frederick's cousin, Henry Stanley, in 1857. In May 2002, the company considered moving its corporate hea...
No, I mean, why is "Stanley" associated with "tool"?
17:34
onebox FTW
Although it would have been way funnier if you had known that already.
My 4-year experience in the US really pays off now.
@keithlayne I think your template function semantic action wish might be easily granted (only halfgrokked your quip earlier while cooking, no viable way to scroll back)....
@sehe is there a way to pass _start etc to a regular function out of a phoenix lambda in Lex?
17:36
Let's hope Clang can start working on its performance and cross-platformness now that C++11 is out of the way :)
@rubenvb completely done?
@KeithLayne pretty much
I'm sure there's a ton of bugs still, but hey, nothing's perfect.
I want results, not excuses. I'm looking at you, Clang!
Thread-local storage is an important one
@keithlayne are you familiar with 'deferred callable objects' and the 'BOOST_RESULT_OF protocol'?
17:38
I repeatedly segfaulted an older version yesterday with simple shit.
@sehe we talking lazy evaluation here?
@yurikilochek It's already there, just OS dependent (like __thread)
I have not gotten much into Phoenix, and haven't found the reference for the useful macros.
I just want to get a mutable reference out of a Phoenix argument type....Y IT NO WORK?
I feel a long detailed description coming on.
many if not most of my recent spirit answers on Stack Overflow apply this technique.
@rubenvb aint that a gcc thing?
@yurikilochek well, Clang is largely compatible with GCC.
17:41
@sehe I have not heard of this website of which you speak of.
:)
lol, the puppy just stirred a storm again.
@rubenvb so they don't rename __thread to thread_local just because not all platforms suppurt __thread and therefore if would be impossible to claim full support?
@keithlayne be sure to read non-lex answers too - the techniques apply. Also, on the (second?)-last one read the comments for alternative approaches and syntactical helpers
17:44
@yurikilochek no, that's some of the stuff being done.
Here's C11 info
Not sure if that went in though.
@R.MartinhoFernandes I did?
Non-POD thread_local is controversial, it seems.
@sehe out of curiosity, how do you feel about the performance of Lex/Qi generated lexers and parsers? Comparable to flex/bison, or something I can relate to?
@DeadMG Now there's a bunch of comments in some answers here stackoverflow.com/questions/11764365/….
oh, yeah
17:46
In my experience slower. The benefit is in the fexible integration with boost codebases
what happened to my first comment on H2C03's answer? it seems to have vanished.
So if it's not present, it's quite almost there. See the bug tracker and search for all bugs thread_local
and I find it difficult to believe that a moderator removed it
@DeadMG Probably flagged.
@DeadMG What did it say?
-1 for unnecessary C I/O or something like that.
17:48
@sehe I would think that generating static lexers would approach flex speeds if not better.
What am I missing in: stackoverflow.com/questions/11695606/… - everything else I try ends up trying to use the copy constructor
FTR, fgets is actually safe-ish, as it takes a size.
@DeadMG there's a "don't mention the vote" movement now
You can get pretty close to bate metal speeds if you play spirit/lex well, though, but at the cost of making the grammar less intuitive (ad with l/yacc and friends, in a way). Anyways, afk for now, @keithlayne
17:48
i.e. just the facts mam
@Flexo Holders and trules.
@Flexo Well, fuck that. I choose whether to comment to explain my vote.
@DeadMG In the general case it kind of makes sense because it focuses people on "how do I improve?" not "ow, my rep went down"
well, not really, because I clearly stated the cause of my downvote, which was the serious problem presented in both answers
@DeadMG The problem is that people get all worked up over the "-1" bit and just ignore the rest.
17:51
well, that's their problem, not mine.
Xeo
Xeo
@DeadMG They allow you to comment, but please no "-1" in there... it's stupid.
@R.MartinhoFernandes holders and trules?
It's a technique described in C++ Templates: The Complete Guide. I haven't looked, but Boost.Move probably uses a variation of it.
@DeadMG if you show the MAGIC_BUFFER_SIZE constant in my code I'll say you were right downvoting. Not before. (I also don't see the point for you being overly sarcastic and eventually rude.) — H2CO3 47 secs ago
Wouldn't his 1024 char line limit qualify?
Holders are the real thing, i.e., the actual object you want to return. You make a trule (transfer capsule), which is just an object that carries the contents of the holder out of the function, and can be converted to a holder (and ideally nothing else can be done with a trule).
Hm, but that won't work with auto and T x = y syntax.
17:53
@rubenvb Yep.
@DeadMG saw and upvoted your comment.
FTR, it's not unsafe.
It just doesn't solve the problem posed.
ah the answer here seems to be that boost::noncopyable is also not movable
Xeo
Xeo
@Flexo Yep, it only got private copy ctor and ass. op
17:55
his answer has MAGIC_BUFFER_SIZE, strcmp, and fun pointer arithmetic. I have no qualms about labelling such things unsafe.
Xeo
Xeo
And the move ctor and ass. op are not generated.
@Flexo, see my comment :)
@R.MartinhoFernandes BTW, you missed a std::string word;
@Xeo so my answer is plain wrong?
Have a question that doesn't seem appropriate for SO as it's more of a "Is this the right way" question instead of a "having a problem" question. Would this be an appropriate place to ask this question? I read the code of conduct and it seems to indicate "maybe" :)
@DeadMG Oh, thanks.
17:57
@Gimballon people like arguing about the right way in general :)
Xeo
Xeo
@Gimballon Ask away, we'll shoo you away if we don't like the question. ;)
did you consult the magic 8-ball first?
Xeo
Xeo
@Flexo Seemingly.
@Gimballon The worst that can happen is that you get us all divided into a fight of those that claim "right" against those that claim "wrong". So, yeah, it's ok to ask ;)
@Gimballon Such questions usually belong in Code Review or Programmers.
but if you ask a question in the chat, and it's not very interesting, expect to get booed out of the room in a very nasty fashion.
17:58
@Xeo deleted. Perhaps you want to write your comment as an answer
obtw
Flexo, your answer would have been fine if you simply did not return as an rvalue reference.
never ever return an rvalue reference from a function.
you should have returned by value, and then taken the result by rvalue reference or value, and that would have been fine.
Ok, so the goal: Create a system that could handle offloaded tasks from multiple frontends. Tasks that don't need to happen immediatly and some that even need to wait a few minutes to happen.
My solution: A daemon. It starts up, forks off, does all the needed "Daemon" startup items. Launches 2 worker threads that immediatly go to sleep on a pthread_cond_wait, 1 "timing" thread that also goes to sleep on a pthread_cond_wait and a networking thread that binds to a port and listens for incoming connections.
Xeo
Xeo
@DeadMG Hm, right, if you call the default ctor from boost::noncopyable in the move ctor
@Flexo: Don't forget the ass. ops
@Gimballon Not interesting question.
learn 2 TBB.
TBB as in thread building blocks?
18:09
yep
Oh noes.
SO is no longer offline!
lol
Ok, thanks for the pointer, hadn't heard of them prior to this. Will look into it for a better solution. Something just felt "off" by how I did that all
Xeo
Xeo
Btw, doesn't make_pair prefer move special members in C++11?
@Xeo yep
18:13
@sehe I think BOOST_PHOENIX_ADAPT_FUNCTION may do it. Let me know if that's bad or something.
@rubenvb i read it up. __thread doesnt call ctor/dtor and thus is poor replacement for thread_local
@yurikilochek it's part of the implementation.
Have you tried thread_local in a recent Clang?
do you have an example I could try?
Clang supports thread_local?
The interesting question is "Clang supports non-POD thread_local"?
Xeo
Xeo
> Thread-local storage N2659 No
18:20
well, that's kinda implied, since that's what the Standard defines as thread_local.
It's not likely to be supported super fast.
Xeo
Xeo
> Last updated: $Date: 2012-05-22
nvm
Non-POD thread_local is something that is not considered well-spec'ed.
well then the question is moot, unless GCC has support for it.
Xeo
Xeo
@R.MartinhoFernandes Usage for threads in a threadpool
18:21
@rubenvb GCC doesn't have it for the same reason.
@Xeo I don't understand.
@R.MartinhoFernandes Then the question is moot. (CC @yurikilochek)
GCC is lacking in atomics.
Xeo
Xeo
Whether the dtors are called when a thread returns to the pool or something like that, IIRC
Ah, you were explaining what the issues were.
guess i'll just have to wait
Or use __thread/"Windows TLS" and manually handle construction/destruction the way you see fit.
Because the thing is underspecced, you could be waiting quite a while.
18:25
@keithlayne I approve of that :<
@sehe Looks like the easiest way to go, the question is, should it be the CALLABLE version instead, or does it generally not matter?
@rubenvb pthreads also gives you pthread_setspecific which works on platforms pthreads platforms without TLS support too
I'm reading about boost::result_of, and I'm not sure how to get a reference out of an arg type with it.
@Flexo I wonder how sucky or optional that functionality is where GCC is missing __thread...
@KeithLayne std::add_reference! XD
18:28
har har
new lows: "fart" is offensive.
@sehe I thought there might be a metafunction to strip off the template?
@rubenvb It's ageist.
My new MinGW-w64 native builds will include short shell(cmd) scripts that will set up PATH for you. Aren't I nice?
you should be able to double-click on them and get a fancy cmd window with PATH all set up.
@R.MartinhoFernandes In the context of a Phoenix lambda.
so it seems there is no std::add_reference. Oh, the assymmetry.
18:32
@rubenvb I assume it just steals some space at the beginning/end of every per thread stack. It's limited to just void* so it's far less work than doing __thread properly.
@Flexo oh, okay. nvm then :)
You get to set a cleanup function with it too, so it's a fairly sane if very C interface
@rubenvb What would it do?
@rubenvb there is in a form of std::add_lvalue_reference and add_rvalue_reference
@R.MartinhoFernandes what @yuri said. I guess I didn't look far enough.
18:36
template <typename T>
struct add_reference
: std::conditional<__TIME__[7]%2,
            std::add_lvalue_reference<T>,
            std::add_rvalue_reference<T>>::type {};
@R.MartinhoFernandes with code like that you'll be employed forever!
that is dirty.
I want a version that behaves differently when compiled during a full moon so I can say it with a straight face to someone
Actually, as it were, it would be always an rvalue reference. I miscalculated and picked the index of the null-terminator, not the seconds digit.
@Flexo Challenge accepted! Will have to wait until after dinner though.
@R.MartinhoFernandes Is typename add_rvalue_reference<T>::type the same as typename remove_reference<T>::type&&?
18:39
@FredOverflow No. Reference collapsing et al.
AddRvalueReference<int&> is int&, RemoveReference<int&>&& is int&&.
Why do we have AddRvalueReference then if I can just say` &&` instead?
@R.MartinhoFernandes en.wikipedia.org/wiki/Lunar_phase#Calculating_phase doing it right is tricky
@Flexo constexpr to the rescue
@Flexo I know, hence the "wait until after dinner" part :)
@KeithLayne it's tedious though because the standard date manipulation functions aren't constexpr
18:43
:)
0
A: Optimizing a code with C++ 2011 move semantics?

Dirk HolsoppleTo take advantage of move semantics you'll have to replace the built-in array with a dynamically-allocated array, so the definition of _data will become T* _data; Then you'll have to modify your constructor and copy constructor to allocate the array for _data to point to and modify your destru...

Newing up an array in the special move operations? No destructor? This answer is so wrong.
@FredOverflow Oh gawd.

« first day (655 days earlier)      last day (4519 days later) »