« first day (636 days earlier)      last day (4314 days later) » 

8:00 PM
@LeviMorrison I like the STL, but Stepanov should have introduced ranges. Stupid foo.begin(), foo.end() noise :(
 
@JimNorton just install the Xcode sdk
you get clang
 
I just noticed some discussion in the transcript about this room and meta.stackoverflow.com/questions/139362/… -- Just FYI, I was thinking of this very room when creating some of the bullet points in the first list. Yes, you guys are a pain sometimes, but you're definitely appropriate :)
 
@DeadMG shrink_to_fit does not mean "clear the vector" :)
 
@FredOverflow True, but you could equally do v = std::vector<T>(v);
 
@FredOverflow That's definitely the part I hate most too
 
8:03 PM
How about std::vector<T>(v).swap(v); or is that not guaranteed to work?
 
@balpha We love to be a pain. Shooting, burning, pins&needles, the works.
oh yeah, forgot it plain has a copy constructor :P
 
v = std::vector<T>(v); will not change the capacity.
 
Hey guys I got a quick question. Im just jumping to to C++ multiple inheritance for interface support and ran into a problem. I am getting a "constructor must initialize base class Interface" error. My interface has only pure virtual functions a destructor. Can I not use constructors with classes that use an interface like this?
 
@DeadMG Just be glad you don't have memory management, or the garbage collector would take care of it.
ducks
 
@balpha Eh. Depending on a collector is more trouble than it's worth.
 
8:05 PM
@JustinMeiners Normally you can. Show us code.
 
cue the universally shitty handling of file/database handles, etc in languages which do have garbage collection.
 
@Nils Oh great, thanks
 
@Fred
sorry
class Interface
{
public:
virtual ~ Interface (void);

virtual void DoSomething (Object* object) = 0;

private:
/* unimplemented copy constructor and assignment */
Interface (const Interface& x);
Interface& operator = (const Interface& x);
};
there is my interface
 
ProTip: If you indent your code with four spaces, it will appear with whitespace preserved.
 
@JustinMeiners the full text of the error is in the "output window" not the "error window" for MSVC
 
8:07 PM
@JustinMeiners You don't really want to prevent copying and assignment.
 
I like the idea of optional garbage collection for certain types and hope that C++ will someday get a standard GC.
 
@MooingDuck im in Xcode not MSVC
I can get the full text
 
@JustinMeiners I think copy constructor suppresses default constructor.
 
garbage collection is just another allocator.
 
@JustinMeiners You need to define an empty default constructor.
 
8:07 PM
@DeadMG Why? It's a good idea sometimes.
 
@JustinMeiners Oh! I see now
 
sure, it's a good one, but it's just an allocator, and it can't ever do more than that.
 
Interface() = default;
 
@EtiennedeMartel Because you needlessly force all derived classes to be non-copyable?
 
@FredOverflow ok thanks
 
8:08 PM
unless they simply do : Interface() in their copy, I guess, but making them do that is pointless.
 
@DeadMG I have that on almost all my classes I have my own copying systeem
 
you don't achieve anything with it
 
@JustinMeiners by defining a custom constructor, you've invalidated the default constructor, so the base class constructor doesn't know how to construct an Interface
 
@JustinMeiners Or just get rid of the unimplemented copy control functions, I've never seen them in interfaces before.
 
@JustinMeiners Well that's a bad sign.
 
8:08 PM
@DeadMG If it's an entity class, then you can bet your mother that its child classes won't be values.
 
@FredOverflow tried it with both
@MooingDuck thanks ill just add a default constructor
 
@EtiennedeMartel But you don't know that it is.
 
@JustinMeiners that seems like a bad idea for most cases
 
@DeadMG Well, a pure abstract class looks like a good starting point for an entity.
 
@MooingDuck which?
 
8:10 PM
@JustinMeiners using your own copying system, click the arrow next to my message
 
@RadekSlupik It doesn't always work, especially if you have empty lines in it. Don't ask why, though.
 
@EtiennedeMartel It can also start, well, pretty much anything that needs a run-time substitutable interface.
 
@Radek Slupik ill remember that
 
@FredOverflow You must indent the empty lines too.
 
if the concrete classes need to be noncopyable, then they should simply do that themselves- there's neither point nor need for the base class to do it.
 
8:10 PM
@DeadMG I don't really see any case, in C++, for something copyable that is to be used in polymorphic situations.
 
@JustinMeiners just type in the things and hit the “Fixed font” button.
 
@RadekSlupik Really? That's kinda stupid. But thanks for the tip!
 
@MooingDuck Its to prevent users from creating certain objects on the stack
 
@FredOverflow Yeah, chat's Mardkown is kinda stupid.
 
@EtiennedeMartel You make it sound as if polymorphic situations is actually the use case for all polymorphic types.
 
8:12 PM
@JustinMeiners Why would you ever want to do that?
Are they ginormous?
 
for example, some COM classes take callback objects. You could easily make that a value-typed member variable.
 
@DeadMG I would probably template that.
 
@FredOverflow I wish you could use #include <header> along with the <pre><code> tags.
 
@RadekSlupik no there is no specific reason why I couldn't its mainly to create uniformity in how they are used
 
@JustinMeiners that seems like a bad idea too. Why are you putting arbitrary requirements like that on an interface?
 
8:13 PM
@EtiennedeMartel Uh, good luck getting Microsoft to ship a template through a DLL, buddy.
 
@MooingDuck I realize your right there is no reason to have them on the interface though
 
@Drise I don't see how that's a reply to what I said
 
@JustinMeiners Let me guess, you are using new and delete?
 
@MooingDuck I picked the wrong message, hold on.
 
@DeadMG If I had to ship a DLL, I would employ a C interface, so that makes the whole point moot.
 
8:13 PM
Ooh, binding of isaac on steam sale. If you don't have it, I highly recommend it.
 
@JustinMeiners Forcing dynamic allocation is not very modern C++ish.
 
@RadekSlupik yes
 
@FredOverflow thats nice
 
@EtiennedeMartel Not really. My point is that you don't always choose when run-time abstraction is used. It can be forced on you by other requirements.
 
8:14 PM
@SamDeHaan It was in a bundle, so I already have it.
 
you can't go changing all the COM code Microsoft ever shipped just because you'd do it differently.
 
Use std::unique_ptr instead of new and delete (or, in rare cases, std::shared_ptr).
 
@RadekSlupik C++ has new and delete? I almost forgot.
 
No, but I can choose not to do it the same way.
 
@EtiennedeMartel I've spent a lot of time on that game. More than I should have.
 
8:15 PM
@RadekSlupik im in a no template enviornment
 
@EtiennedeMartel I don't even know their syntax. :P
 
@EtiennedeMartel Right. Of course you can. But people still need to do it the other way.
 
@MooingDuck Chat must have moved when I went to click on "reply"
 
@JustinMeiners What.
 
@RadekSlupik You still need new for std::unique_ptr currently.
 
8:15 PM
and thus those use cases do exist.
 
@JustinMeiners lol that sucks.
@FredOverflow That's only once in your entire codebase.
 
@RadekSlupik yes I have to work around problems in weird ways like this
 
@RadekSlupik Everybody seems to be in love with make_unique :)
 
@JustinMeiners Why can't you use templates, if I may ask?
 
@RadekSlupik He's probably using Visual Studio 6.
 
8:16 PM
@FredOverflow He's using Xcode.
 
@RadekSlupik not supported by compiler. Im not working on o desktop enviornment
 
@FredOverflow because then we can tell newbies not to use new, which makes delete errors almost non-existent.
 
@JustinMeiners Buy a better compiler. Problem solved.
 
@JustinMeiners Well, the relation between "C++" and "a compiler that does not support templates" is tenuous at best.
 
Wait, you're on Xcode, that means your two choices are GCC and Clang.
While your target platforms are either Mac OS X or iOS.
 
8:17 PM
@EtiennedeMartel Or a custom buildsystem.
 
I've only spent 10$ so far this steam sale. Must. Resist. Skyrim.
 
You can create an external build system target in Xcode.
 
@RadekSlupik Yeah, but why use Xcode then?
It's a worse IDE than VS.
 
@EtiennedeMartel Because you only have a Mac? xD
Or because you like the UI, or whatever.
 
@RadekSlupik Perhaps it's time to find where @DeadMG lives, buy a plane ticket and steal his PC, then.
 
8:18 PM
@EtiennedeMartel well its a multi platform project, so while Mac is what I work on, the code has to compile on a platform where it doesn't not have the template support
 
@JustinMeiners What is that platform?
 
@JustinMeiners all platforms that run GCC have template support. Which is pretty much all platforms
 
@EtiennedeMartel Or just steal the robot from itself.
 
@JustinMeiners What the fuck platform is that?
 
Come on, tell us. It's not like it's confidential or anything.
 
8:19 PM
@JustinMeiners C++ without templates isn't really C++. You're essentially programming in a 20 year old language if you use "C++ - templates".
 
Sounds like some embedded shit.
 
C++ without templates is PHP.
 
@EtiennedeMartel Nah.
 
@RadekSlupik No, it's Java, minus the GC.
 
then you'd be compiling for it, not on it.
 
8:19 PM
@DeadMG Indeed.
 
@RadekSlupik C++ without templates is 0?
 
Yeah, I forgot. PHP is a bug.
 
haha believe me i am not the decision maker on this project
 
@JustinMeiners ANSWER THE QUESTION
 
8:21 PM
The person who wrote the PHP lexer must be shot. If he survives, he must be shot again.
 
And then eaten.
 
hmm, File A clearly returns the string "ADD_RECIPIENT" to the calling application, and it works, but the calling application does not have the string "ADD_RECIPIENT" in it anywhere. I am confused
 
@FredOverflow Y U NO “Y U NO”
 
Because he's no good.
 
8:23 PM
 
I am going to write a Python IDE in Python.
 
oh sorry
 
I believe the main problem is Symbian,
 
Xeo
:>
 
8:26 PM
but other people worry about that
 
Ell
@RadekSlupik go ahead
 
Oh I mean Python and Objective-C.
 
lol
 
TkInter sucks ass.
 
8:28 PM
@RadekSlupik I have my doubts you get through with this
 
@Nils Why?
 
writing a complete ide
plan?
 
Well IDE an editor would suffice.
 
@JustinMeiners Symbian's standard development library is the "Qt Template Library" I'm pretty sure templates work fine.
 
An editor with accurate syntax highlighting, code completion, documentation and debugging facilities.
 
8:31 PM
Is there a tag ?
 
C++ without Boost is like food without bacon.
 
Holy fuck balls. That is the third cicada that has flown at my office window at full speed in the last ten minutes. The impact is very loud.
 
Xeo
@Drise Damn @Cicada
 
@Drise You have three of them? Lucky bastard.
 
what is boost?
 
8:33 PM
user image
2
 
Xeo
@FredOverflow Rather unlucky, if we consider what a handful one Cicada can be :P
 
good watch :P
 
Boost is a set of libraries that extend the functionality of the C++ programming language. The current release contains over eighty individual libraries, including libraries for linear algebra, pseudorandom number generation, multithreading, image processing, regular expressions, and unit testing. Most of the Boost libraries are licensed under the Boost Software License, designed to allow Boost to be used with both free and proprietary software projects. Many of Boost's founders are on the C++ standards committee, and several Boost libraries have been accepted for incorporation into bot...
 
@SeçkinSavaşçı Library for C++ that is supposed to be the solution to all the things.
 
don't answer my question
 
8:33 PM
@SeçkinSavaşçı Why do you ask a question if you don't want an answer?
 
come on, if there is anyone doesn't know boost, he must just be kicked.
chuck testa!
 
@FredOverflow #4, 5, and 6 just hit.
 
BTW I didn't use boost for maybe more than 10 projects
I'm good with C
I need performance so I need C
 
I didn't use Boost for most of my projects; most of my projects were written in Objective-C or Ruby. :P
Some in C.
 
@SeçkinSavaşçı it's a third party extension to the standard library. Large chunks of the standard library are copy-pasted or modeled after boost. Boost is like a "training/trail" for library components.
 
8:35 PM
psh. "performance". you do know c++ can be faster than C these days, right?
 
#7 and 8
 
Xeo
@SeçkinSavaşçı Worst argumentation ever.
 
lol the speed of a language.
 
Wtf is wrong with these cicadas?
 
@cHao C still kicks ass for optimization case
 
8:36 PM
@Drise How do you handle so many Cicadas?
 
I'm implementing a paper on free-from 3d object recognition, and my c++ prototype was slow!
 
@SeçkinSavaşçı not even close to what C++ does.
 
Xeo
@SeçkinSavaşçı Good chance your C++ sucked.
 
@SeçkinSavaşçı Why would C be faster at anything than C++? For example, std::sort (C++) beats the crap out of qsort (C).
 
@SeçkinSavaşçı no, it doesn't. They use the same optimizer.
@SeçkinSavaşçı that just means you don't know C++ very well
 
8:38 PM
Maybe. But my Intel C Compiler still kicks its C++ equivalent in optimized output. So I have practical evidence here.
 
you mean the "C++ equivalent" code you wrote. which we've established means nothing.
 
@FredOverflow Hell if I know.
 
@SeçkinSavaşçı they must not have been equivalent then.
 
@SeçkinSavaşçı If you have C code that compiles to slower machine code with a C++ compiler, I'd like to see it.
 
@FredOverflow monday 12:00am?
@FredOverflow deal?
 
8:42 PM
@SeçkinSavaşçı what?
 
I'll come at midnight with code, since weekend i'll be on vacation.
 
@FredOverflow you need to give him time to try and find an example. :P
 
Nah, I just need to go to work and use Intel compiler for compilation.
I have only MSVC here.
 
@FredOverflow Correction: Windows (the glass variant, not the software).
 
maybe gcc/g++ can handle a good example.
 
8:46 PM
@SeçkinSavaşçı Oh. Sure, just take your time. It's not like we're dying to know right know :)
 
Wouldn't the C++ compiler use the same optimization patterns as a C compiler when compiling C code?
 
@JimNorton Don't confuse us with rational logic. Performance and optimization is a sensitive topic.
2
 
@JimNorton yes
 
That's what I thought.
 
@JimNorton this is what I receive pastebin.com/w2rq3scB
 
8:50 PM
@NicoBellic Nico! Welcome back.
-1
Q: Addition [tag:no-boost]

DriseFor those who can't use boost, there should be a tag that exists to simplify specifying that boost is not an option for an answer. I understand that SO answers are meant to be as a resource for many, but it is fairly obnoxious to have to specify that boost is not an option. I also feels it clutte...

 
Hi @Drise !
 
@NicoBellic Oh crap... sorry to hear that.. It was worth a shot..
 
@JimNorton yep. It's weird though because I installed nload this way on another mac and it installed just fine. Just not on my mac :/
 
Toilet paper when used with a toilet roll holder with a horizontal axle parallel to the wall has two possible orientations: the toilet paper may hang over (in front of) or under (behind) the roll. The choice is largely a matter of personal preference, dictated by habit. In surveys of American consumers and of bath and kitchen specialists, 60–70% of respondents prefer over. Despite its being an apparently trivial topic, people often hold strong opinions on the matter. Advice columnist Ann Landers said that the subject was the most controversial issue in her column's history. Defenders of ...
TP++
 
@JimNorton Under is much easier to tear
 
9:00 PM
@Drise gtfo
:D
 
@MooingDuck You can use the metal holder as a blade. Works quite well imho.
 
@Drise it's harder to grab and unsanitary. The only pro is cats don't unwind it
 
Lounge<C++> greatest debate
 
It's not a debate, everyone knows it's B, duh.
 
@MooingDuck @Cat s?
@MooingDuck Unsanitary? Source?
 
9:02 PM
Over reduces the risk of accidentally brushing the wall or cabinet with one's knuckles, potentially transferring grime and germs.[24]
Over makes it easier to visually locate and to grasp the loose end.[25]
Over gives hotels, cruise ships, office buildings, public places and homeowners with guest bathrooms the option to fold over the last sheet to show that the room has been cleaned.[26]
Over is generally the intended direction of viewing for the manufacturer's branding, so patterned toilet paper looks better this way.[27]
 
Ell
I know who would choose A?
 
@Ell Drise apperently
 
@webarto B.
 
@webarto B, for sure.
 
I'm glad such great intellect is being used to establish whether A or B is better.
 
9:05 PM
@webarto B
 
But B, deff.
 
If you prefer A, you're an idiot.
 
"In a more traditional preliminary survey of 1,000 Americans, Cottonelle found that "overs" are more likely than "unders" to notice a roll's direction (74%), to be annoyed when the direction is incorrect (24%), and to have flipped the direction at a friend's home (27%)."
 
@RadekSlupik I'm an idiot.
 
Sinrod observed of his survey, "60 percent of those who earn $50,000 or more prefer it to be over and 73 percent of those who earn less than $20,000 prefer under".[40] On what that proves: "I don't know, but it's sure interesting."[39]
 
9:07 PM
God. 2k rep is going to be hard to get. Review is now practically useless to me.
 
@Drise Answer two-four question a day. If each question gets 2 upvotes on average, and say, and 1/10 are marked "correct", that's 67.5 rep/day for 18 days.
 
@Drise I like over
 
19
Q: Is it possible to read infinity or NaN values using input streams?

DriseI have some input to be read by a input filestream (for example): -365.269511 -0.356123 -Inf 0.000000 When I use std::ifstream mystream; to read from the file to some double d1 = -1, d2 = -1, d3 = -1, d4 = -1; (assume mystream has already been opened and the file is valid), mystream >&...

You mentioned you wanted to answer this?
 
"A Grand Rapids, Michigan, toilet paper enthusiast named Bill Jarrett argues that previous polls have been too small. He wants a national referendum with a least one million votes, with the result to decide a "national toilet paper hanging way" to be enforced by "the toilet paper police".[93]"
 
@MooingDuck Also, my knowledge scope is limited, and it's hard to answer questions. I think I've established this before.
 
9:14 PM
Well I'm glad I was able to spark such a conversation.
 
in PHP, 34 mins ago, by PeeHaa
But serious guys, this isn't a debate. It's B right? right?
 
@Drise no, I mentioned that I'm pretty sure I know the answer, but it would require me to find sources, and I'm too lazy
 
we agreed that it is B :peaceandtranquility:
 
user1174868
Iteration is like the bud light of programming
 
@Drise also, sehe's answer has everything I was thinking of, and more, all well researched and sourced.
Parkinson's Law of Triviality, also known as bikeshedding or the bicycle-shed example, is C. Northcote Parkinson's 1957 argument that organizations give disproportionate weight to trivial issues. Parkinson demonstrated this by contrasting the triviality of the cost of building a bike shed in contrast to an "atomic reactor" [sic]. Later, Poul-Henning Kamp applied the law to software development and introduced the colour of the bike shed as the proverbial trivial detail receiving disproportionate attention. Argument First mentioned in C. Northcote Parkinson's 1957 book Parkinson's law,...
 
9:23 PM
In the context of programming language design, one encounters Wadler's law, named for computer scientist Philip Wadler.[5] This principle asserts that the bulk of discussion on programming language design centers around syntax (which, for purposes of the argument is considered a solved problem), as opposed to semantics.
Referenced in the Wiki Parkinson's Law of Triviality
 
Ell
who argues about syntax? o.O
 
@Ell everyone
 
Ell
I have not heard such o.O Maybe it's because I'm in the c++ room most people agree?
 
@Ell where does the { go after if(boolean)? Same line or next line?
 
Ell
well it's a matter of preference, as long as it's consistent?
 
9:35 PM
@Ell because we're tired of fighting over it
 
Well I prefer the next line, however when I first started programming I put the brace on the same line.
 
In computer programming, an indent style is a convention governing the indentation of blocks of code to convey the program's structure. This article largely addresses the C programming language and its descendants, but can be (and frequently is) applied to most other programming languages (especially those in the curly bracket family). Indent style is just one aspect of programming style. Indentation is not a requirement of most programming languages, where it is used as secondary notation. Rather, programmers indent to better convey the structure of their programs to human readers. In p...
 
Ell
I prefer
if(something) {
statements;
}
 
if( something )
{
statements;
}

FTW
 
Xeo
@JimNorton Next discussion point: spaces in if statements and other things
 
9:40 PM
@Ell I only have {} if statements is more than one line
@JimNorton I only do that if the boolean context is more than one line
 
@Xeo Yeah, I don't know how to keep chat from removing those spaces
 
Xeo
@MooingDuck Yeah, even if it's a for that would be allowed to go without a brace
@JimNorton I meant between / before / after parens
if (something) vs if ( something ) vs if(something) vs if( something )
 
@Xeo Oh yeah, spaces between ( ) FTW
 
@JimNorton put four spaces at the beginning of each line, or click the fixed format button near the "send" button, and/or read the newbie hints
@JimNorton never. die.
 
if( TRUE )
{
    blah;
}
else
{
    blah;
}
Ah there we go
 
Xeo
9:43 PM
if(blub)
  f();
else
  g();
 
I tried the fixed font button before, but for some reason this is the first time it worked for me.
Omitting the braces even for single line blocks is a SIN! :-)
 
@MooingDuck I like to edit "Thanks" out of questions. Easy rep.
 
@Drise do you get rep for that?
 
Xeo
@MooingDuck 2 rep until 2k
 
Wow, I'm going on an edit spree then!
 
9:47 PM
What's the link for "How to accept answers?"
 
328
Q: How does accepting an answer work?

jjnguy How does accepting an answer work? When should I do it? Why can't I accept my own answers right away? Which answer should I accept? Return to FAQ index

 
Although, it's probably still more fruitful to ask and answer questions in the long run..., yes?
And people are helped...
 
0
A: If i have a fixed size char array of padded ascii digits which I know refers to an unsigned integer, what is the fastest way to convert it to such?

FredOverflowI assume the first char is reserved for a "potential sign" and is always "space"? Because otherwise, you would only need a char[11] instead of a char[12]. Any, fixed size allows manual loop unrolling: int parse(const char(&b)[12]) { return ((((((((((b[1] & 15)) * 10 + (b...

 
@FredOverflow First! upvote
 
@Drise Did you even read the answer? :)
 
9:52 PM
Man, if anybody help me I will accept his answer, but your answer is not good. I found solution myself just now. I'll post it in my question. — Adam 2 mins ago
@FredOverflow Shit no! do I care? Not really!
 
Should "Regards, UserName" be at the bottom of a question?
 
@JimNorton Nope. Y U TAKING MY EDITS BOY?!
 
@Drise: He used the -r flag, whatever that is
 
Ok great... edit I will do.
 
@MooingDuck Mine works. I promise it does lol.
 
9:55 PM
@JimNorton that's hotly debated, but general consensus is no. (Alf woudl disagree, to the point where he changed his name)
@Drise what is the -r flag? Maybe it's relevant to why your script doesn't work in his situation
 
@MooingDuck Recursive maybe? But that makes no sense. And based on his criteria, it works.
 
@Drise based on his criteria that he wrote in the question.
 
@MooingDuck -r, --regexp-extended
 
Two edits, one "Regards" and one "Thanks"
thanks Drise
 
@Drise k
 
Xeo
9:58 PM
@JimNorton That's just stupid
and will like only be getting 1 approval, with an improvement by the reviewer
 
@Xeo Not according to some people
 
@Xeo I just accrued about 20 rep on edits today alone. Most of them being "Removed "Thanks" from the end of the question"
 

« first day (636 days earlier)      last day (4314 days later) »