« first day (1020 days earlier)      last day (3921 days later) » 

5:00 AM
@undefinedbehaviour . what are you even.yes the standard explicitly defines performance no call shall take more then 3 nanoseconds
 
@undefinedbehaviour What's relevant to performance in C or any other language? The fact that people actually care about how fast their program performs in real-life?
 
I think I've made my point. @EiyrioüvonKauyf doesn't even know which optimisations are permitted in a valid C implementation.
@EiyrioüvonKauyf Consider what might happen if the function call is optimised away.
 
.
i'm not even going to bother
also btw you like the standard
> The semantic descriptions in this International Standard describe the behavior of an
> abstract machine in which issues of optimization are irrelevant.
 
How can you justify your comments regarding "a stack" which might be entirely optimised away, too.
 
5:02 AM
§5.1.2.3p6.
Read that. It's 5 points below what you just quoted.
 
genius
scroll above
i never said it had to be a stack. i said emulate a turing machine and you can run it
 
Once you've read that, discriminate between "abstract machine" and "actual implementation".
 
show me anything about optimization that uses your "actual implementation" in the standard
Alternatively, an implementation might perform various optimizations within each translation unit, such
that the actual semantics would agree with the abstract semantics only when making function calls across
translation unit boundaries. In such an implementation, at the time of each function entry and function
return where the calling function and the called function are in different translation units, the values of all
externally linked objects and of all objects accessible via pointers therein would agree with the abstract
 
What, you mean tail call recursion? Dead code elimination?
 
you can turn those off you know with this thing called options and tail call recursion isn't always the best idea
 
5:04 AM
You can, but it's not worth mentioning speed if you're not going to mention optimisations.
 
The entire 1000 page C++ standard has 10 mentions of the word optimization.
Interesting.
 
@undefinedbehaviour Depends on how you define things. It requires a last-in, first-out structure to support (for one example) recursive calls. From an abstract viewpoint, LIFO and stack are basically synonymous. OTOH, the restrictions it places on that LIFO structure are quite minimal, and certainly don't require a stack supported by a stack pointer register, "push" and "pop" instructions, or anything on that order.
 
... likewise, it's not worth profiling if you're not going to enable optimisations.
@JerryCoffin Yes, but that's assuming the program in question actually has unoptimisable recursive calls.
 
@undefinedbehaviour no it is. you just said tail call recursion yourself you can manually implement good and bad tail call recursion. remember how we said COMPILERS
 
"no it is" what, my subliterate, little friend?
Are you smarter than your compiler? I highly doubt that.
 
5:08 AM
oh that's funny
11 Recursive function calls shall be permitted, both directly and indirectly through any chain
of other functions.
and @undefinedbehaviour yes you can be
look at the difference between GCC and MSVC
they are GENERAL
for certain programs you can write better compilers
 
That doesn't mean they're required in a translated program. Consider int main(void) { }. Where is the stack?
 
for example memory allocation
GCC does crappy allocation
it wastes SHIT loads of memory
but it's really fast
you can write a better compiler
 
... and it does tail call optimisation...
 
yes
memory allocation does tail call recursion
obviously
 
So your discussion discriminating "recursive fibonacci" from "iterative fibonacci" is irrelevant, if the recursion is tail recursive and the compiler is gcc.
 
5:10 AM
. yes that's obviously what i mean when i talk about how one compiler can optimize
 
... in fact, presuming the program produces the same output every time, your compiler might even optimise the function calls away, producing an O(1) program that merely prints the static output.
How is your algorithms class, now, my subliterate, little friend?
 
no
"motivation: people using gnu c as a portable assembler suffer from the
fact that there is no way to make gcc do proper tail recursion. as a
result, some scheme compilers (bigloo, stalin and hobbit, which is
used by guile) are not standard compliant (scheme requires proper tail
recursion) and at least one prolog compiler (gnu prolog) has switched
from generating c code to assembler, making it non-portable (it is
currently only avaible for x86 and sparc). the prolog-like mercury
has to jump through some (non-portable) hoops to use gcc as an
where is your compiler now my literate friend
no one says shit is done
and you can overflow tail call recursion
static code analysis isn't god
 
If you're trying to prove that converting code using recursion to code using loops is impossible, then you should probably ask them that...
 
come on try doing tail call recursion in python without obfuscating code in case of stack throwups
you're so clever right
 
@EiyrioüvonKauyf Congratulations, you found some 13 year old claim that GCC does not TCO.
 
5:15 AM
mhmm
 
Now can you please stop escalating this?
 
guido likes nice tracebacks because stack frames
@R.MartinhoFernandes i got confused what the point of this was wayyyy back
 
(Namely, I'm not too happy with the "subliterate" shit being thrown around.)
 
technically i never said subliterate
 
@EiyrioüvonKauyf Sorry, I mean plural "you". English is terrible.
 
5:17 AM
the only insult i did was dumbass :| but i got called subliterate quite a bit
 
I'm fine with you discussing this, but please keep it civil.
 
You didn't call me stupid?
 
where
show me your citation
 
Oh, neat. You deleted it. "are you stupid? No standard on the planet "defines speed". Have you even taken an algorithms course?"
 
sorry i don't see it
it's not in the standard
 
5:18 AM
Alright, both of you cool it.
 
@Mysticial technically it's C :P so Gordan can't get mad about that
 
@R.MartinhoFernandes To be honest I was going to just bin all of it but I was watching a movie
 
@Rapptz you should bin all of it
 
@R. I suggest that you consider that EiyrioüvonKauyf might be a troll.
 
hahaha
mhmm i collect my bridge taxes with a side of my gold
 
5:20 AM
Question the constructiveness of anything it has to say, and decide where to go from there.
 
mhmm it
what could it be
 
I can take my own conclusions, thank you.
 
I'm off to do more important things. Have a nice day, and learn how to cite relevant parts of the C standard :)
 
If these messages aren't binned, I'll be sure to bookmark them. :)
 
@R.MartinhoFernandes I have no doubt.
 
5:21 AM
1 min ago, by undefined behaviour
I'm off to do more important things. Have a nice day, and learn how to cite relevant parts of the C standard :)
..... AHAHAHHHAHAH right
@Rapptz that was eventful :3
 
One of the worst discussions of the night.
 
^
@DeadMG would be crying
and binning left and right
it was lacking in pedanticism. i'm sorry; i failed you master :|
 
@Rapptz I guess I should count myself lucky I didn't even care to look at it.
 
@R.MartinhoFernandes you are. it was bs-ery
 
@R.MartinhoFernandes Yeah I didn't either but it was pretty moronic.
 
5:26 AM
._. i'm happy cat wasn't around
or i would have gotten shit tossed
 
Gosh, I feel horrible.
Terrible morning.
 
@Borgleader constexpr A() = default; what does this mean ?
how can a constructor be constexpr
 
if it does exactly the same thing everytime?
 
I just never saw that on a ctor before
and like whats the possible benefit of that would it be constructed at compile time?
 
5:32 AM
guys when iterating a vector, itr is my iterator, itr++ or itr+1 is better?
 
++itr
 
@JoelSeah depending on the context these two dont have the same semantics
@A.H. no clue
 
the itr is not within the for-loop. but in a 'if' condition
 
Need more context...
 
@JoelSeah depends i like using *(itr++) in my iterations from front to end
 
5:35 AM
@A.H. Erm, it lets you do compile time computation?
 
here is the code snippet tny.cz/9ee5450b
 
You may prefer it[1].topicid
I don't think you want it++ there, because it advances the iterator.
(And it does not return the next one)
 
@A.H. A lot of the constructors in the standard are constexpr
 
err i wan it to compare the next element while iterating the vector
 
@Rapptz show me pls? :3 i haven't seen this one that often
 
5:39 AM
@JoelSeah And what you are doing is mostly right.
 
so compile time computations using objects then ?
 
it[1].topicid seems to only compare the 2nd element
 
@JoelSeah 2nd starting at the iterator.
 
@R.MartinhoFernandes then where is it wrong?
 
It breaks down when itr is the last one.
I'm sure if you run it with debug iterators enabled it will blow up unconditionally and point this out as well.
 
5:42 AM
@EiyrioüvonKauyf Off the top of my head: pair, piecewise_construct, tuple, bitset.
 
All of <chrono> too.
 
unique_ptr too it seems
 
Though this was a defect for a while or something, so there are implementations around without it.
 
then wad should i change? bcoz it currently suits my needs..
 
@JoelSeah It does not.
It compares an element that does not exist.
There's no "next" element after the end.
 
5:44 AM
@CatPlusPlus I think it is already done by Kyle in the [star leaderboard] (can't find link)
 
The loop should only go to accDetails.end()-1.
(And preferrably with a assert(!accDetails.empty()) just above it.)
 
@R.MartinhoFernandes wouldn't the current loop only compare end and not the one after it?
 
@A.H. accDetails.end() is not an iterator to the last element. It's an iterator to "one-past-the-end".
 
yeah I ment that end
not the valid end
 
You can't dereference it.
And (it+1)->topicid does.
 
5:46 AM
right
 
@R.MartinhoFernandes if i do wad u say with the accDetails.end()-1. i get the value '2' instead of the value '3'
 
Assuming it doesn't order pizza instead, who knows if the topicid that produces matches or not the last one?
 
@JoelSeah I don't know what that means, but from what you've shown, I'd guess it means 2 is the correct answer.
 
@Rapptz so what does A(const A&) = delete do?
 
5:50 AM
delete the copy constructor
 
i have this in my vector:
topic1:...
topic1:...
topic2:...
topic2:...
topic3:...
topic3:...
i should have 3 instead of 2 after comparing the topcids in the iteration
 
@Mysticial he's still here ....
 
Times like this, I really wish I had static_if =[
 
old SO looks a lot cooler than new SO.
 
I don't know what that even means.
 
5:55 AM
The questions asked back then and the answers provided are really of high quality. I don't know why.
 
@R.MartinhoFernandes it seems ur accDetails[1].topicid gives me the value of '3'. Why is that so?
 
@R.MartinhoFernandes There's a way to disqualify certain functions from instantiation / consideration by using templates and SFINAE, right?
@Rapptz Or, the really shitty questions from back then have floated to the bottom of the sea.
 
sank/sunk.
 
@JoelSeah with end-1 you will get 2
 
@A.H. No.
@ThePhD You can't prevent instantiation. You can't prevent it from being picked for overload resolution.
 
5:56 AM
@A.H. Yes with end-1 i will get 2. but after including accDetails.topicid gives me the value of 3
 
Well, at the moment a function in my templated class is stopping compilation because it's being instantiated when an instance of the class is made
 
@R.MartinhoFernandes can't prevent it from being picked?
 
So if I make it a template function, I can stop the problem function from being instantiated simply when the templated class with the offending types is made. But then I also need to add SFINAE to make it not error when it's put into the overload resolution pool, right?
 
@Rapptz i agree
:|
 
@Rapptz Ooops. Yeah, meant "can".
Code wins.
@ThePhD Oh, I see. Can you show some small example with the same thing?
 
5:59 AM
@R.MartinhoFernandes coliru.stacked-crooked.com
his comparison is !=
 
I think I know where this goes.
@A.H. Well, then 2 is the correct answer.
 
hehe yeah
 
If you don't believe me that the code that iterates up to end() is just broken, see for yourself coliru.stacked-crooked.com/… That's not a 3.
 
@JoelSeah is that supposed to get unique values in any vector or very specific problem?
 
If you want to count unique values (assuming they are all clustered together as in the example), you need to count 1 as soon as the vector is not empty.
The loop as is counts changes: there are only two.
At least the correct version of the loop, I mean. The original one is broken, period.
 
6:02 AM
Now this is a good one.
 
@StackedCrooked offtopic. wait were you against kitty?
 
@oh i see. that 's why the count is 2 instead of 3 bcoz the iteration runs past the 'end'
 
@EiyrioüvonKauyf lol
 
so when u add end()-1 it will then compare against the last element?
 
6:04 AM
With end() it compares v[5] to the nonexistent v[6]. With end()-1 the last comparison is v[4] against v[5], which is fine.
 
rbegin is really handy for getting the last element of a container. I wish I realized this sooner. (I had only thought of if in terms of reverse iteration.)
 
but what i dun get it, why is it 'it[1]'? can it be 'it[2]' or 'it[3]'??
 
@ThePhD Oh, I see. That is really annoying, yeah.
 
@R.MartinhoFernandes ^ It's simpler when I boil it down. I sort of know how to solve it using templates and SFINAE on the return type or on a defaulted void* parameter or something
 
its basically array length and index of last element of array
 
6:05 AM
@JoelSeah Yes.
 
Still, I don't really know if an elegant way to solve it, other than just.... well. Using ugly SFINAE and templates. =[
 
@ThePhD The solution there is a strong typedef :)
 
@ThePhD So, what do you prefer: remove the T version for int, or remove the int version for Arf<int>?
 
@R.MartinhoFernandes okay thanks! u saved me!
 
@R.MartinhoFernandes Remove the T version for int, I suppose.
 
6:07 AM
@StackedCrooked :P
 
@ThePhD You can either template the function with template <typename T = U> and disable_if on U != int, or use a partial specialized base instead if you want to avoid making it a template.
 
Were any traits added in C++14?
 
@ThePhD That looks annoying indeed. Yet I have never encountered this situation.
 
Alternative without making the function a template coliru.stacked-crooked.com/…
Annoying as fuck? Yes.
But quite effective.
 
lol
operator() for integral_constant isn't explicit?
 
6:13 AM
Now with 100% less public bases, just in case you're paranoid: coliru.stacked-crooked.com/…
 
Eh...
In the end, I just deleted the entire function signature. =/
 
@ThePhD Why thank you for wasting my time :P
 
I worked hard on that DisableIf.
:(
 
Sorry!
It's just -- especially for the base class stuff -- that's a tall order to place on my class. >_<
 
Why is it?
 
6:15 AM
I don't think disabling is that much of an order tbh
 
0
Q: Specific user is editing in profanity

corykendallThis user is repeatedly attempting to edit in profanity to posts: http://stackoverflow.com/users/2633473/george-bush?tab=activity This doesn't seem like the right way for me to bring this up; I'm following the accepted answer from this question, which states that this is as good a way as any to ...

^^ lol, someone is bored
 
Did you guys know you can do this?
 
@Rapptz yes
 
Damn markdown breaks it.
 
Well, the base class idea gets unwieldy when your class is something, uh. Really large.
 
6:16 AM
@Mysticial More like pissed off.
@ThePhD Why?
The base class does not get bigger as the class gets bigger.
 
He is George Bush after all
 
Noo
I meant for like
arrgh, maybe I just don't understand the concept well enough. :c
 
http://stackoverflow.com/questions/tagged/c++*
 
The base class is only as big as the function you want to handle.
 
Damn it markdown. I hate you :(
 
6:18 AM
Paste it escaped as code.
 
Uh.
 
Xeo
Ohayou
 
@Rapptz The fuck.
 
I found out about it yesterday. Pretty neat
 
@Xeo おはようございます、クセオさま。
 
6:20 AM
[tag:C++*]
?
It's not a tag...
 
@Rapptz I thought + had to be encoded
 
@MarkGarcia copy paste it to your address bar
 
Xeo
Btw @Rapptz, I found that ctrl+T also changes the text to latin letters
Which is much easier to reach than F10
 
@Xeo Yeah that'll never work for me.
Ctrl + T reopens a tab in every software I use.
 
Is the new chat project on Github?
 
Xeo
6:21 AM
@Rapptz Same, but during IME mode, it doesn't
Guess how I found out :P
 
I just tried it, it does both haha.
I prefer F10
 
javascript
is sorta painful :|
 
Xeo
When I have "uncommitted" kana in the input, it switches. If not, it opens a new tab
 
it's like bad codegolf
 
There's a project for chat?
A replacement for the Stack Overflow Lounge?
 
6:23 AM
@MarkGarcia yeah they got mad at the lack of control and @Gordon
 
@MarkGarcia I think someone didn't like oneboxing
2
 
Oh.
 
@MarkGarcia lol
 
@R.MartinhoFernandes ?
I know there's some argument with the mod(s). But never heard of a chat project.
3 mins ago, by Johan Larsson
Is the new chat project on Github?
 
Woo another enlightened badge
 
6:27 AM
so is it on github ?
 
:c
I'll just... figure it out.
 
We gave you two solutions.
 
I know, I'm just dumb. :c
 
Well, technically 3.
 
hi! anyone have an idea about the order that the preprocessor execute this directives: file inclusion, macro expansion and conditional compilation ?
 
6:39 AM
yes. standard ideas mostly. What do you need to know? (it's definition, conditional, inclusion, expansion in that order, I think)
@MarkGarcia tough luck. template <class project> struct Lounge<project>; is an incomplete type and the enclosing namespace cannot legally contain user-defined specializations. /cc @R.Mar
 
Are ms selling any Azure? Feels like they have been spamming about it forever.
 
@sehe LOL. I get it now.
 
whimsicalness
 
@sehe sometimes conditional involve the value of a macro that need to be expanded, like #ifdef A_MACRO in this case if A_MACRO was defined it must have been expanded sothat the conditional will work as anticipated
 
6:48 AM
@AlexDan Yeah. I'm not entirely sure. But you can basically expect the preprocessor to "know" what is has seen up to the current point. At least, preprocessing is specified as a potential single-pass transformation.
> What do you need to know
 
In general C++ preprocessor is ok, but somewhat limited
 
^ also, in case of doubt, test it (run it through cpp -)
 
Damn it. Mouse is malfunctioning. I'll be forced to use vim.
 
That's good news
 
Also morning
 
6:50 AM
Morning.
 
Ahem. Already back in the lounge. Is your site block addin disabled?
 
morning @BartekBanachewicz
 
@sehe last time I checked you left after me, and when I got here today you are alredy there
Also I kinda was woken up early today and can't sleep anymore so uh.
 
@sehe one explanation which im not sure about is like this: first the cpp will execute file inclusion even if it's inside a conditional directive, then it will execute macro expansion and conditional directive at the sametime, since they are related.So I was wondering if this is the implementation used by the preprocessor
 
@Alex use cpp and see for yourself
 
6:54 AM
@BartekBanachewicz lol. I detect some vinegar
@AlexDan "first the cpp will execute file inclusion even if it's inside a conditional directive" - absolute no
 
@BartekBanachewicz you dont know this sort of things by testing
 
@AlexDan yes you do. by doing the right testing. It is sequential. No 'fuzzyness' involved.
7 mins ago, by sehe
> What do you need to know
 
@sehe That would make for some really weird workarounds... all includes in the header !
 
@sehe i am not sure when my kitchen supplies came into this, but if you say so... :)
 
#define A 2
#if A>1
#define B 3
#endif

I want to know how the cpp deal with the code above
 
@AlexDan B will be defined
 
yes but how does the cpp end up with this result. we know that each cpp directive get executed at a time, so if first macros are expanded then the conditional directive is tested, in this case if A>1 then the B macro will get replaced by 3 in the source file. so we started from macro expansion then conditional directive then macro expansion for the second time. this doesn't sound like one-pass to me.
 
No, they are processed sequentially
Uh dunno really what you are trying to do
 
7:20 AM
Recursive and one-pass are not mutually exclusive.
 
thanks for your help, that actually make sense
@R.MartinhoFernandes I guess because a macro can be expanded to another macro which then get expanded too, so recursive. but you can't have a macro that expand to a preprocessor directive, thus one-pass. is this what you are trying to say ?
 
Xeo
one-pass means one pass over the source file, not that every translation phase is only executed once
 
Hahaha thats just great
i really should be sleeping though
 
@Xeo I couldn't undestand the difference, can you explain more.
 
Xeo
You can execute the same translation phase multiple times while still going over the source-code only once.
 
7:36 AM
@Xeo doesn't repeating a translation phase require starting over the source-code again ? is there any example when you need to repeate a translation phase without starting over the source-code again.
 
@Borgleader guys .. i read reddit too
 
Congratulations.
 
I don't
except when people link me to it
 
This Emmet plug-in is neat.
 
holy crap, my insane prototype works
 
7:44 AM
@jalf .... if even the coder calls it insane
 
So, tell me: With void (*ptr)() = func_name;, is (*ptr) a hard coded, specific use of parenthesis to create a function pointer? Because just generating *ptr as the expression of the parenthesis seems functionally identical to void *ptr() = func_name;
 
@EiyrioüvonKauyf yup. A node.js server with a c++ plugin handling http authentication using Kerberos
 
Not sure if I described that well...
 
@Hamster the second is not a function pointer, it's a function called ptr that return a pointer to void
 
@AlexDan I understand that, but I'm trying to see what makes parenthesis do that.
 
Xeo
7:51 AM
That's just how the C++ grammar works
 
it's the operator precedence
 
Xeo
No
Operator precedence has nothing to do with this
That's a declaration, not an expression.
 
Alright, thanks.
 
JBL
Good morning !
 
> goobye
 
7:57 AM
This is probably going to go down as one of the most contentious posts on Meta. Answers and OP have been voted on 359 times at my time of posting, +257, -102. Comments have been voted on 356 times. This is interesting. — Emrakul 8 hours ago
holy WTF
 
I think the compiler tries to take the longest token as possible, so void* is longest than void, but in the second example it doesn't have a choice.
 
@jalf how the fridge do i run javascript on code after facebook has loaded 30 external libraries/files. atm that's complicated to me T_T since it doesn't seem to be all on one page dammit
 

« first day (1020 days earlier)      last day (3921 days later) »