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

9:00 PM
there is something in c++ which lets you figure out the type of an object.. but I don't remember how to use it and how it was called :(
 
typeid?
 
decltype()
 
What do you need it for?
 
Xeo
Three answers, all correct. Nice.
Now it just depends on the usage :P
 
I only count two answers.
 
9:01 PM
exactly thx
 
it's summer in some parts of earth right now
 
Xeo
Err, yeah, nvm.
 
And only one is correct (typeid). Through it's possible that the question is wrong and the correct answer is actually decltype.
 
why does SO show snowmen. is it not an international site?
I think that'S mean
 
I'll upvote such a complaint.
 
sbi
9:03 PM
@RMartinhoFernandes LOL! Over time, archaeologists from virtually every part of the world have presented findings indicating that humans developed first in their part of the world. :) Let's see what will have happened to this theory in a decode or so. (Also, I like how they write that the disappearance of the elephants "must have imposed considerable nutritional stress on Homo erectus." But maybe H.E. made them "disappear"?)
 
sbi
10 mins ago, by sbi
I find a snowman silly on an international site. It's currently summer in big parts of the world, and there's no winter ever in many others.
 
Where is summer?
 
Those damn elephants.
 
@sbi ohh!
we are so alike
 
9:03 PM
Southern hemisphere?
 
That's spring.
 
sbi
@JohannesSchaublitb That is news to me.
 
lol
perhaps whether a snowman or a nakedman is displayed should be computed based on the user's location?
 
I want a woman in a bikini.
 
9:05 PM
Just make it hot chicks for all the year.
Problem solved.
 
Xeo
@JohannesSchaublitb I think I'd go through a proxy in australia if that's the case.
 
@CatPlusPlus :)
 
But then the text would be upside down.
 
Xeo
who cares, I'll flip my monitor!
 
Flip the table!
 
Xeo
9:06 PM
0
Q: C++ Trickery : output actual enum, not its value

RM1970Say I have an enumeration: typedef enum MyEnum_ { MY_ENUM_BLUE, MY_ENUM_RED, MY_ENUM_GREEN } MyEnum; And that I have a method that gets an "MyEnum" as parameter. I'd like write to log file the value of that MyEnum, but I don't want 0, 1 or 2 to appear there--- I'd like to output the actu...

Recruiting close votes
@CatPlusPlus The virtual table? I think we had that already.
 
If I try to insert a duplicate into a std::set, I get an iterator to the existing element in the set. Why the fuck does Java not offer something similar in java.util.Set? Or should I say java.useless.Set?
 
@sbi i would upvote yours xD
 
Writing algorithmically focused coded in Java just plain sucks.
 
Xeo
Dec 2 at 10:05, by Pubby
(╯°□°)╯︵ ┻━lɐnʇɹıʌ━┻
 
@RMartinhoFernandes Interesting comment reply. I guess it shows what happens when you frame all your thinking by a single idea.
 
9:08 PM
@FredOverflow "útil" is "useful" in Portuguese. Was that a pun of yours too?
 
sbi
@JohannesSchaublitb My what?
 
your complaint
 
sbi
@JohannesSchaublitb Which complaint?
 
to the discriminatory act
that they show snowmen in summer
 
sbi
@JohannesSchaublitb Huh?
Have you tried to talk to your doctor about those hallucinations?
 
9:09 PM
lol
 
rofl
 
When I look at my CRT screen upside-down I can see the refreshing
 
Your what?
 
Xeo
You have a CRT screen? Those actually still exist?
 
What's a C runtime screen?
 
9:10 PM
Yep - that's the extent of how much I need a new computer
 
huh
how do you use a constructor call with static member variables?
 
what?
 
@DeadMG i dont understand your q
 
Like other variables.
 
Xeo
What exactly do you mean?
 
9:11 PM
MSVC thinks I'm trying to define a function or someshiz
 
Xeo
Post your code
 
sbi
@Xeo I have a cow-worker who says he has a hard time staring at modern monitors. They are straining his eyes. He's always on the outlook for a new CRT monitor, as a replacement when his current one goes belly-up.
 
@DeadMG Are you the grilled newbie that is on the menu?
 
template<Wide::Lexer::TokenType token> const ExpectedType match_single_token::expect( []() -> ExpectedType {
    ExpectedType e;
    e.insert(token);
    return std::move(e);
}());
 
Xeo
@sbi lol
 
sbi
9:12 PM
@DeadMG Please read the newbie hints. Among other stuff, they explain how to post code here.
 
Xeo
@DeadMG Mind formatting that?
 
@sbi I'll swap.
 
@DeadMG what's THIS
 
meh, it hardly requires any indentation at all, I figured I'd just leave it
but if you want
 
@sbi This one kills my eyes and eats tons of power
 
9:12 PM
@DeadMG missing the template arguments?
 
what template arguments?
the class is a
oh yeah
 
shouldn't the return value be ExpectedType&&?
 
Xeo
haha
 
Why do you use a virtual stack when there is one defined in memory for each process?
 
Xeo
9:13 PM
@Pubby No!
 
@Pubby Not if you want to return by value.
 
I know somebody who works for a company that makes displays (barco.com) and he swears that CRTs are better because they are blacker.
 
In fact, never.
 
what does the std::move do?
 
sbi
@Xeo You laugh, but as a programmer he is really afraid of the time the last CRT will be gone and he has to stare on a flat screen monitor all day. (By the way, he is no nutcase at all, and I'm absolutely sure he has some unique medical condition causing a real problem. Just saying...)
 
9:14 PM
but that doesn't seem to have solved my problem
 
Xeo
@sbi Maybe he should see an expert and get a screen build for him specifically?
 
post testcase or it didn't happen
 
CRTs go for $1 on craigslist. $10 for a lifetime supply
 
@Pubby Makes rvalues.
 
Xeo
@DeadMG Try without the lambda for giggles?
 
sbi
9:14 PM
@Pubby You use std::move for dancing. It helps you with those std moves, you know.
 
LCD is much better for the eyes than CRT imo.
 
What a lame joke.
 
works fine when I replace the constructor call with =
 
Xeo
Now imagine if std was a class representing STDs. A whole new meaning to std::move!
 
But why use std::move when return type is value?
 
9:15 PM
how can that be an IMO
 
sbi
@Xeo He might have to win the lottery first.
 
@Xeo what abut std::exit xD
 
sbi
@RMartinhoFernandes How would you know? You're a robot.
 
@Pubby To move the object into the return value.
 
sbi
@JohannesSchaublitb std::abort.
 
9:16 PM
@JohannesSchaublitb Some people use the exit as an entrance.
 
smells religious
 
@RMartinhoFernandes I thought copy elision did the same thing. Is std::move better?
 
std::copy
 
@Pubby actually @DeadMG did it wrong
he should get rid of the std::move
 
9:17 PM
no
 
so that copy elision can apply
 
you're not supposed to need the std::move
 
Not on buggy MSVC.
 
unless your "ExpectedType" can actually be a reference
 
but I add it because VS cried when I removed it
 
Xeo
9:17 PM
Y'know, when I'd design a language, the entry point would be dungeon_entrance. All those /* here be dragons */ comments would finally make sense!
4
 
@DeadMG and you will possibly loose performance
 
He should get rid of MSVC.
 
@Pubby Maybe the type is not copyable.
 
@CatPlusPlus I'm literally writing a replacement.
 
because then NRVO cannot happen anymore.
 
9:17 PM
No idea.
 
Yeah, you will loose performance and it is suck.
 
Took you a bit too long for that.
 
Xeo
@CatPlusPlus You really like that quote, don't you?
 
meh
 
9:18 PM
Déjà vu.
 
the real performance would be using MPL and constructing at compile-time
but I careth not an awful lot right now
mainly, I just want to see if this'll work :P
 
sbi
@Pubby None of them would work for the rest of his life, though. And also, when everyone is working with real high resolutions, being the only one stuck at 1280x1024 might become a severe disadvantage.
 
Lots of tweets to me about stl vectors. I know all about them, I just used a list for some new code as a quick n dirty first implementation.
 
sbi
@JohannesSchaublitb OMG, performance is loose!
 
sounds like he's being a pussy and backing off because he realized he's an idiot
 
Xeo
9:22 PM
@RMartinhoFernandes std::list should be the last of your ropes to reach for
 
@keithlayne Exactly my thoughts.
 
Xeo
:2084469 multiline markdown 2 : 0 Kian
 
@Xeo if only there were a std::rope
 
> After show signup page & recaptcha image
> When you puting all everything then again show recatpcha image then ok
> When we puting 24 hours after same number then it's working but next all time when we puting number then show directly recaptcha only.
 
@Xeo Yes, you got the dude's name right.
 
9:23 PM
Is it me or does that make no sense?
 
My brain can't process that.
 
Xeo
@RMartinhoFernandes Can't even get stuff on your first edit right
>_>
<_<
 
@KianMayne Ok, I was going to ask you exactly that.
 
So far it works with vectors, but complain when I also want to call it with a list.
 
9:23 PM
I wonder what happens to the snowman with 10+ messages
 
I thought you were showing us examples of a new language called retard
 
@Nils Lists don't have random-access. That's normal.
 
Because list's iterators are not random access.
 
@Pubby turns into a Yeti
 
@Nils You wrote a function that requires random access iteration. Linked lists don't support that.
 
9:24 PM
You need a specialized algorithm for lists.
 
try a deque
 
ah that's what the rand access iters are
 
or a std::rope
 
You can use std::distance but it'll be slowpoke.
Or std::advance, probably.
 
So if i have an iterator of type list<something> I cannot say iter += 7?
 
9:25 PM
Nope.
 
of course not
how would that be implemented?
 
Xeo
slow
 
linked lists can only go one node at a time
 
@DeadMG 7 times iter++?
 
std::advance does that.
 
9:25 PM
so this works with vectors and what else?
 
Deques.
 
theoretically, if you only used distance/advance, then the performance is up to the stl implementation
 
any random-access container
 
Arrays.
 
std::deque.
 
9:26 PM
deques, circular buffers, arrays
 
If you take two iterators as parameters, crappy C arrays too.
 
why strikethrough crappy? they are crappy
 
you don't need to specialize for lists when somebody has done that for you
 
Time to suck in Tribes a bit.
 
9:27 PM
but you can generalize for random access iterators
 
sbi
@cliffski "std::list should be the last of your ropes to reach for" http://chat.stackoverflow.com/transcript/message/2084477#2084477
 
You can't say it's not funny when someone uses linked lists and complains about random access performance.
 
agree
 
sbi
@RMartinhoFernandes Now let's see if he comes down at us.
 
It's hilarious!
 
9:28 PM
let him
 
Of course he won't.
 
@sbi Oh noes you revealed our secret hideout!
 
Xeo
@sbi He'd need 20 rep on SO for that
 
cliffski has SO account?
 
Xeo
Yes. No. Maybe. Who knows?
 
9:29 PM
Come on, he tweeted about copy-pasting code using void* casting.
 
He won't last 10 seconds in here.
 
2
Q: C++ _inline is being ignored in a singleton and showing up in my profiler. How come?

cliffskiI have a lot of classes in my project accessed by a singleton like so: _inline GUI_BS_Map* GUI_GetBS_Map() { static GUI_BS_Map obj; return &obj; }; As I understand it, this code should be inlined. I have the Visual Studio (2005) options set to inline anything suitable, and my profi...

 
sbi
@RMartinhoFernandes I was faster. Again. Beam.
 
Singletons and forcing inlining.
 
sbi
9:31 PM
@RMartinhoFernandes OMG. Singleton. Who would have guessed?
 
And void* and std::list and manually managed arrays.
 
Xeo
@sbi Ha, only 13 rep. Not enough to get in here.
 
Yeah, I'll go play Tribes.
 
sbi
@Xeo One answer would do.
 
His singleton question got two votes! WTF?
 
9:32 PM
Do you really want to argue with him here? :P
 
Xeo
Who the fuck just voted that singleton question?
 
ah well I could use a c array or a string
 
Sneaky animals, that's who.
 
sbi
@Xeo We could downvote him into Skyrim. :)
 
Who is this Cliffski guy?
 
9:33 PM
so I go to bed, thx for the help and good n8 everyone who has about the same time
 
Some game developer.
 
Famous ?
 
he is like the batman of c++
 
or why are you talking about him?
 
9:34 PM
I sometimes use std::list as a queue.
 
sbi
@ManofOneWay He gained some fame here today for a silly tweet.
 
@StackedCrooked std::queue, eh.
 
I see
 
6 hours ago, by jalf
switched from STL list to a fixed sized array for some stuff, and speed is up by a factor of 100. I expected maybe just double :D
 
It adapts deque by default.
 
9:34 PM
@CatPlusPlus Probably.
 
We always need someone to laugh at.
 
folks
7
A: Clang warning flags for Objective-C development

Chandler CarruthFor context, I'm a Clang developer working at Google. At Google, we've rolled Clang's diagnostics out to (essentially) all of our C++ developers, and we treat Clang's warnings as errors as well. As both a Clang developer and one of the larger users of Clang's diagnostics I'll try to shed some lig...

excellent
 
Xeo
Holy.. !
 
> TL;DR Version: Please use -Wall and -Werror at a minimum on any new code you are developing. We (the compiler developers) add warnings here for good reasons: they find bugs.
WTF isn't this the fucking default?
My compiler only works decently if I ask politely. That only makes sense if you're talking about ick.
 
That Cliffski guy tweets a lot
 
9:37 PM
@RMartinhoFernandes Well I guess prefetch fails with lists.
 
Sorry, what are you talking about? I think I got lost.
 
the tweet up posted
 
-Wall is not all? That's confusing
 
If we all voted him up and he came in here, and then we all downvoted him, would he be kicked out of the room immediately? That would be sweet. It should have a message "Sorry, but you suck. Take a hike." or something.
 
@Pubby That's what -Weverything is for!
 
9:40 PM
wonder if there's a warning setting that warns you about not using enough warning settings. bob dole bob dole
 
-fomit-warning-pointer
 
@JohannesSchaublitb On going to post this to my dev team at work :) Stuff like this greatly supports my petitioning for increased attention to compiler warings.
 
@Pubby Maybe there is, but it's not turned on by default.
 
Would an OAP's child buy computer lessons as a christmas gift?
 
@Pubby -Wall should be interpreted as all non-subjective warnings.
 
9:42 PM
-Wall should not exist.
I want -Wnone instead.
 
Id est, opt-out, not opt-in.
@CatPlusPlus No, I meant, I want -Wall by default, and -Wnone is like what you get nowadays if you omit -Wall.
 
I just remembered! I have a project to work on :D
It's the appointments program for and my friend that we'll use when we book sessions
 
# if you want:
$ g++ a.c
# you would need to write:
$ g++ -Wnone a.c
# if you want:
$ g++ -Wall a.c
# you would need to write:
$ g++ a.c
 
Xeo
Hm.
Searching for flags with google is no good
 
9:47 PM
Can SQL be read as S-Q-L or Sequal because tbh calling it sequal just sounds crazy
 
Xeo
Atleast not if you just try "-Wthe_flag"
 
Add the compiler name.
 
Xeo
@KianMayne Structured Query Language - S Q L
@RMartinhoFernandes doesn't help
 
@Xeo Yeah that's what I thought
 
Xeo
9:48 PM
Know why? the dash in front of the flag. A dash means "without this"
 
Jeez people you suck at searching. gcc "-Wall"
 
Compiler warnings beyond -Wall don't get along with boost though. (Although including boost as a system library helps to resolve this.)
 
That's exactly what I do.
Why would I care about warnings on boost?
 
Guys at my job seem to introduce new warnings with each edit.
 
3
Q: Performance gap between sorting a list and a vector of structs. C++

smilingbuddhaI wrote a simple C++ code to check the speed of sorting data , represented in the form of a list and then a vector. In the case of the list I am getting time as 27 seconds. For a vector I get 10 seconds. Why the huge performance gap? Aren't the algorithms used for sorting the list and the vecto...

Hehe, where did I see this thing recently?
@StackedCrooked Ouch.
When warning output becomes spam, you might as well just turn them off.
 
Xeo
9:54 PM
Or slap those guys
 
@RMartinhoFernandes Two recent examples: (1) forgetting a return statement in a non-void function (again), (2) adding a catch block for an exception type that already had a catch block of that type.
 
Sneak -Werror into the build :)
 
@RMartinhoFernandes That would cause major breakage of the builds.
 
See you guys later doing some hard work for once ;)
 
Xeo
For every new warning they introduce, have them pay for one breakfast. That'll teach them soon enough.
 
9:57 PM
@RMartinhoFernandes However we recently released a new version of the software which means that now (post-release, a fresh new start) is the best moment to introduce this. I'll discuss it at the next meeting. And I'll forward this post mentioned by Johannes to our dev team.
 
Don't forget to shoot the dissenters. That will guarantee the success of this plan.
 
@RMartinhoFernandes If I can enable -Wall and -Werror into the buildsystem then the problem will take care of itself.
Since they can't commit non-compiling code.
 

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