« first day (584 days earlier)      last day (4367 days later) » 

5:00 PM
@Quent42340 varargs with the ... inside the function parameter list is obsolete.
 
@johnathon although that's true, the really easy things should be ruled out first, like using an identical copy you have
 
Use variadic templates or std::initializer_list, either of which supports zero arguments.
 
@Quent42340 google "initializer list". (Also: what's your compiler?)
 
@Potatoswatter Obsolete? Since when?
 
@stdOrgnlDave the copy you speak of is not an identical copy
 
5:00 PM
@Potatoswatter he doesn't want variadic templates for that
@Quent42340 since C++11 came out
 
Xeo
@std: No, I copied the dll from the winsxs/wzateveritwas folder
 
@johnathon my 3 copies all hash the same
 
@MooingDuck G++
 
@stdOrgnlDave smh
 
@MooingDuck And when VC++ turns into a real boy compiler :(
 
5:01 PM
@Quent42340 then you want an initializer list
@RMartinhoFernandes yeah.... That's why I put a GCC button and a clang button in my visual studio toolbar.
 
@johnathon I guess that they must have hash collision across two different hash types? why are you shaking your head?
 
@MooingDuck Okay thanks I'll look for that.
 
@Quent42340 Since they were replaced by the other features I mentioned. Well, since long before that. Variadic functions are a feature of C that only works with types that work with C, i.e. no references or classes.
 
@Xeo if you're using an identical copy and it ain't working then I suggest you listen to @johnathon next
 
GAH! Thousands of lines of log files, and the line with my problem is: "Line 001: Unknown exception: LastErr 2"
 
5:03 PM
@stdOrgnlDave give him what i gave you earlier today
 
Sounds relevant.
 
Since when does Mac OS X ship with PostgreSQL?
 
Some time ago.
 
Hmm cool. Not that I'll use it.
Bleh, SQL.
 
I guess you won't like the schemaverse.com then.
 
5:08 PM
@xeo open a command prompt and try "regsvr32 /u c:\windows\system32\rasapi32.dll" then reboot
 
> Compete against other players using raw SQL commands to command your fleet.
 
@RMartinhoFernandes wtf? xD
That game is almost as geeky as 0x10c.
 
I find the source code of glibc to be nowhere near readable. Is that normal
 
@Cicada yes.
 
5:10 PM
twa
yes
 
Come on, it's C. It ought to look like a mix of assembly and Perl.
 
unless you're me.
then it's pretty close to unreadable
 
So this thing must be "maintained" over and over by the same people?
 
I did a short presentation on Karel the Robot today, and we're gonna include him in our next installment of the C++ for freshmen course :)
 
5:11 PM
@Cicada the c lib functions are mostly done in assembler
 
I thought they involved syscalls.
 
I'm cloning the glibc git right now
 
@johnathon I was looking at malloc and it's C but I find the code hard to read.
By hard I mean I can't actually read it and tell what it does
 
@Cicada You looked at the implementation of malloc? I never bothered to do that.
 
it allocates memory
 
5:13 PM
@stdOrgnlDave funny
 
holy crap glibc is taking a long time to clone
 
@RMartinhoFernandes most c lib functions have a dedicated assembly implementation
 
@FredOverflow I was gonna answer this stackoverflow.com/questions/10706466/…
 
I guess there's lots of pointer casts inside malloc. At least I had them in my own toy memory manager.
 
@Cicada malloc is magic, and one should not attempt to comprehend it. It's all about faith.
 
5:14 PM
@MooingDuck LMAO
 
@MooingDuck Who was that guy again who wrote that incredibly fast malloc?
 
right
 
malloc is implemented using mmap on Mac OS X. :P
 
5:14 PM
@Xeo did that work out for you?
 
@RadekdaknokSlupik So? It's not just a mmap call, you know?
 
C dynamic memory allocation refers to performing dynamic memory allocation in the C programming language via a group of functions in the C standard library, namely malloc, realloc, calloc and free. The C++ programming language includes these functions for backwards compatibility; its use in C++ has been largely superseded by [[New (C++)|operators new and new[]]]. Many different implementations of the actual memory allocation mechanism, used by malloc, are available. Their performance varies in both execution time and required memory. Rationale The C programming language manages memory ...
 
oh its only just transferring real slow, the source is only 8mb
 
Wow, so many celebrities!
 
5:16 PM
toirtoisegit FTW!
 
@stdOrgnlDave Noooooo....
 
@Cicada troll some
 
That thing that pollutes your shell shortcuts? Hell no.
 
@MooingDuck malloc has not been replaced by the operator new, but rather by operator new :) It took me a while to understand the difference.
 
5:16 PM
lozers dont understand powah of teh tortoise
 
@Cicada Also has a completely borked mental model for git, they tried to smash svn names into git and it's confusing as hell
 
CLI master user reporting in.
 
ick, you're a CLI guru?
 
18
Q: Difference between 'new operator' and 'operator new'?

SandeepWhat is difference between "new operator" and "operator new"? Thanks.

 
@FredOverflow I sorta understand the difference. I get it right when I really think about it.
 
5:17 PM
@stdOrgnlDave ick is the INTERCAL compiler :P
 
operator new doesn't call constructors.
 
Hi, can you please clarify the question? Looks like there is typo somewhere. — Dima Malenko Dec 11 '09 at 4:54
lol
 
@Xeo ping
omfg glibc source is huge, ~184mb
 
@stdOrgnlDave I prefer the full managed way of things. C++/CLI is just confusing.
 
5:20 PM
@Cicada not confusing, but stupid
 
@stdOrgnlDave In many cases those words are swappable
 
@Cicada not in this case
 
@stdOrgnlDave MS actually enjoys creating a variety of C++ spinoffs.
Here we go with C++/CX
I can't wait for their C++/-- derivative
 
hmm, In MSVC9, I found where my code is logging inside a catch(...). How do I figure out who threw and what they through
 
it's called C#
 
5:22 PM
@Cicada There's already a C--
 
@Cicada Just wait, someday Microsoft will fall in love with pointers and release *C++
 
@MooingDuck don't catch at all and trace the unhandled exception is one dumb way
 
Why does VLC keep crashing on my WMVs??? :(
 
(*C)++ or *(C++)!?!? DAMN YOU MICROSOFT
 
@MooingDuck GHC used that.
 
5:23 PM
@FredOverflow update it
 
@stdOrgnlDave it is the seventh catch handler, just as backup
 
@MooingDuck disable exceptions
 
@RMartinhoFernandes PITA to google for
 
it'll just crash the normal way
 
5:24 PM
@stdOrgnlDave What is the current version? I have 2.0.1
 
or like I said remove that handler, and trace the unhandled exception
 
@stdOrgnlDave and I didn't write this
 
@MooingDuck do it just to figure out where the code crashes. don't do it as a project change.
 
@MooingDuck Time for $ my-favourite-vcs blame file.cpp followed by a trip to someone's desk.
 
@stdOrgnlDave oh, that's actually a good idea, thanks
@RMartinhoFernandes FOr the person who wrote the catch?
Hmm, will a "throw 1234;" be caught by a "catch(DWORD & e)"?
I don't think it will. Also WTF are we throwing 1234 for? (Apperently when new char[length] returns NULL)
 
5:28 PM
Off to the swimming pool, because I'm like that. Good evening people in my timezone. The others please shift that to the appropriate greeting.
2
 
I doubt I can get permission to change it either, since I can't be 100% certain I wouldn't break existing behavior >.<
 
@Cicada good morning to you too
 
@MooingDuck don't check your change in. here's what you do. check out the most recent version, make the modification to the handler, then check the version out again and fix the bug. so you know, no changes end up being made to the project in the repository, but only to your local copy. or are you using CVS? :-\
@Cicada good afternoon
omfg hurry up git clone
I don't have all day
 
MSVC's __checkReturnfunction annotation is genius for dealing with code(rs) which still use return values. I need to scatter it liberally throughout my code.
 
5:32 PM
@MooingDuck check my ideone, catch(DWORD& e) will indeed catch a number
 
@stdOrgnlDave thanks for that
 
:)>-
 
wait a second why the fuck is this in malloc.h
#ifndef void
when the fuck is void never defined
 
@stdOrgnlDave I'd rather not deliberately make my code different than the official in that way
@stdOrgnlDave fascinating
@stdOrgnlDave that's a preprocessor symbol, I've never seen void defined as a preprocessor symbol before.
 
Hi, can anyone please tell me why this code is failing to compile ? pastebin.com/5q3zsrD3
 
5:39 PM
@Michael What reason does the compiler give you?
I stopped reading after using namespace std;
 
@Michael #include <list>
 
When I print child->leaf->items->name[0] in my debugger (dbx it prints the first symbol of the "name" which is what I want, but when I use it in my program it says left operand of "->" must be pointer to struct/union, does anyone know a safe way of getting the first character of the name value here?
 
@MooingDuck look no further than malloc.cpp in glibc
 
@FredOverflow all kinds like type int unexpected
 
@PeteHerbertPenito what are the types of child, leaf, items, and name?
 
5:40 PM
@MooingDuck i didn't know this website, is it like online compiler ?
 
leaf is a union, child is a struct, items is the same struct, name is char *
 
@FredOverflow is it wrong to put using namespace std; ?
 
@Michael without "#include <list>" it is useless...
 
91
Q: Why is 'using namespace std;' considered a bad practice in C++?

ManaOkay, sorry for the simplistic question, but this has been bugging me ever since I finished high school C++ last year. I've been told by others on numerous occasions that my teacher was wrong in saying that we should have using namespace std; in our programs, and that std::cout and std::cin are m...

 
@Michael yes
@PeteHerbertPenito oh, `child.leaf.items.name[0]
 
5:42 PM
@Michael Did you split the code into .h and .cpp files by any chance? That doesn't work with templates.
 
ty Mr @MooingDuck
 
@Michael usually we consider it a bad idea
 
@FredOverflow i did at first, then i read that its impossible
 
@PeteHerbertPenito -> is only for pointers and pointer-like-things
 
@FredOverflow thanks.
 
5:43 PM
this dividing question is driving me crazy. I think I am just gonna ask "what is the best way to multiply a number by 2"
 
@bamboon no idea what you're talking about
 
I'm having no problem reading malloc.c, a bit slow going but that's all
@bamboon x * 2
 
@MooingDuck ty, but for some reason I am getting this error: left operand of "." must be struct/union object
 
75
Q: Which is better option to use for dividing an integer number by 2?

AbhineetWhich one is the best option and why for dividing the integer number by 2? For eg:- If x is an integer variable then, which option from the mentioned below is the best option for dividing by 2? Technique1: x = x >> 1; OR Technique2: x = x / 2;

 
that answer is WRONG
 
5:44 PM
Here's a design question:
 
@stdOrgnlDave what are you cloning? (or is it windows being slow?)
 
>> 1 will almost always return the wrong result for a signed integer in the negatives
if you want to divide by 2, type in / 2. the compiler will figure out how to do it right
3
it's that simple
 
@stdOrgnlDave doesn't he state it and give an example?
 
@Michael It works perfectly here, so you must have hidden something from us.
 
Suppose I have a polymorphic container hierarchy with base class BaseContainer, and also a hierarchy of iterators derived from BaseIterator. Does it make sense to have the BaseContainer have some sort of virtual begin/end interface?
 
5:46 PM
@bamboon the answerer is wrong.
 
It seems that iterators can only work by value, not by reference.
In other words, dynamic allocations seem inevitable.
 
@KerrekSB Polymorphic container hierarchies suck.
 
@PeteHerbertPenito for which part?
 
@FredOverflow It would seem so.
 
@KerrekSB sounds like you need Templates(tm)
 
5:46 PM
@stdOrgnlDave x + x is much much fastorz!!!
 
I wonder if there's an abstract argument that such problems can always be transformed into a single, normal container of polymorphic object handles.
 
@KerrekSB I would think so
 
@MooingDuck The problem is that iterators are always returned by value.
 
@FredOverflow I didnt implement the destructor. thought i didnt have to
 
@Michael If you have nothing to put into the destructor, don't declare it in the first place.
You can't just declare something and then not define it. That's like saying "I have a present for you, but you'll never see it!"
 
5:48 PM
gethostbyname y u obsolete! u so easy to use!
 
@FredOverflow when you put it like this... makes sense. thanks
 
@KerrekSB boost::any or similar. (If you're going to have a polymorphic container, this is what you're reduced to)
 
@bamboon the C++standard explicitly states that bit shifts working on signed integers is undefined behavior that is implementation dependent
 
Xeo
@std: Sorry, had to go afk. Sup?
 
@Xeo did the regsvr32 thing work for you?
 
5:50 PM
@stdOrgnlDave yeah, I saw the comment
 
@MooingDuck boost::any uses dynamic allocation, though. Yes, I thought of that one, too. I could probably implement the virtual iterator hierarchy with a technique like that.
 
Xeo
Can't test atm, sry
 
@Xeo its not osmething to test, its to fix your computer. write it down and try it later
 
Xeo
Yeah, I meant that I can't try it atm. :P
Have/had to babysit my lil brother for a bit
 
@KerrekSB I did that once (using an internal buffer when I could). It was really slow. :/
 
5:55 PM
My mistake, ty vm @MooingDuck
 
@PeteHerbertPenito oh, did you figure it out?
@stdOrgnlDave you've been in chat enough to know how to use the reply functionality correctly
 

« first day (584 days earlier)      last day (4367 days later) »