« first day (451 days earlier)      last day (4488 days later) » 

4:06 PM
@AlfPSteinbach not bad :¬{
 
Why didn't they make a Terminal Velocity II?
 
@AlfPSteinbach Terminal deceleration?
 
GCObject** nextPtr() const { return (GCObject**)&const_cast<GCObject*>(this)->m_nextNode_; } looks cool
 
@thecoshman yes. as we say in norway, it's not the fart that kills, it's the smell
^ (Of course, that's a bad translation to English of Norwegian "det er ikke farten som dreper, det er smellet" -> it's not the speed that kills, it's the bang)
afk
 
4:13 PM
@AlfPSteinbach well... never has some one got so lost in translation it was found again
@AlfPSteinbach so yeah; Norwegian kind of just looks the Swedish chef from the Muppets.
 
I just found a class in our source that wraps an std::map to work exactly like a CMap (MFC).
Be amazed!!!
 
why does ideone.com/huvDG compile?
 
@awoodland why it shouldn't?
 
@awoodland because nothing is wrong with it...
 
@Abyx Bar* to const Bar& with no dereference
 
4:17 PM
Weird.
 
it's not just me then?
 
ephemeral
 
expand the typedef and you get compilation error
 
@sbi well, that certainly was an unexpected solution to the problem at hand :O
 
sbi
@awoodland No, Comeau agrees, basically:
 
well, I've certainly never seen such behaviour before
 
sbi
Comeau C/C++ 4.3.10.1 (Oct  6 2008 11:28:09) for ONLINE_EVALUATION_BETA2
Copyright 1988-2008 Comeau Computing.  All rights reserved.
MODE:strict errors C++ C++0x_extensions

"ComeauTest.c", line 6: warning: type qualifiers are meaningless in this declaration
    const type t = type(b);
    ^

"ComeauTest.c", line 6: warning: variable "t" was declared but never referenced
    const type t = type(b);
               ^
No errors.
@awoodland The same with VC10:
test.cpp(10): warning C4189: 't' : local variable is initialized but not referenced
(Not that I'd believe VC had any authority here.)
 
@sbi the first of the comeau warnings is just that it's const const with the typedef expanded
 
gcc warns about the unused variable t (not suprising) and breaking of strict aliasing rules when dereferencing b in const type t = type(b); but compiles just fine
so why does that break strict aliasing?
 
sbi
4:30 PM
@awoodland I know. The second is spurious, too. That's why I said "no errors".
But that's three compilers accepting this code. I'd have thought it's illegal. What am I missing?
 
0
Q: Typedef const reference from a pointer

awoodlandWhy does this compile: class Bar {}; int main() { Bar *b = 0; typedef const Bar& type; const type t = type(b); } G++ (4.5, 4.7 snapshots), Comeau and MSVC all are happy but warn about unused variables. What does the compiler think it means? Is it UB? Why isn't it an error?

 
4:55 PM
@awoodland well what's the difference between void(0) and (void)0?
let me try...
 
sbi
@AlfPSteinbach The difference is that one looks right and the other looks wrong. :)
Anyway, I'm afk now.
 
I can't believe I didn't realise that T(v) doesn't always have constructor semantics
 
Xeo
Well, it's mean since it really looks like it would call the constructor of user-defined types. :/
But it's actually a static_cast<T>(v), which in turn will do the ctor call (for user-defined types)
 
so if I'm writing template code how can I write something that can only ever be static_cast, copy construct or some other constructor for things like:
template <typename T, typename V>
T foo(const V& v) {
  return T(v);
}
where there's no way I want to be silently reinterpret_cast ing
 
You can do the static_cast<T>( v )
 
5:00 PM
0
Q: What would be needed in C++ so that we can always use references and never pointers?

Stefano BoriniAccording to what I found on the net, you should use references as much as you can, except when you must use a pointer. As far as I understood, the only reasons to use a pointer are: when dealing with raw memory or when you may have to return null or when you are dealing with the returned new...

 
Xeo
Well, return static_cast<T>(v)
 
oh and that calls the copy constructor
 
well if T and V were the same type static_cast would call the copy constructor
 
posted on January 10, 2012 by Herb Sutter

Hilarious and apt. Nice work, Alena and Jim. Filed under: C++

6
 
5:07 PM
^ warning: big picture (18.1 MB)
 
I rather like "concepts shipwreck"
 
Haha, the iostream!
You'd think the istream would run into the lake, though..
 
Xeo
"Bugs live here and there and everywhere" lol
 
@KerrekSB: Since it seems more sensible to talk that out here: You write your programs without using any pointers?
 
What's "ACE"? Love how realloc is outside.
@Grizzly If at all possible, yes.
You really only need pointers at the boundaries of C++
and as the result type of ::operator new.
 
5:18 PM
@KerrekSB: So no STL containers either?
Or smart pointers (Which is what I was talking about)
 
@Grizzly Why no STL containers? Of course containers. And smart pointers too of course, since you need to handle dynamic objects.
The simple thought experiment of reading an arbitrary number of words from the standard input should convince you of the need for dynamic structures.
The question is only how to handle dynamic problems the C++ way.
 
@Xeo How lyrical :)
 
I'm quite convinced of that
 
@Grizzly Because you use pointers! :-)
So.. what is this "ACE" in the far south?
 
as do you ;)
 
Xeo
5:23 PM
I just noticed a problem in the map though.. we don't have std::rope :(
 
@Xeo Note how it's beyond the C++11 boundary
What are those cardinal directions?
 
google gave me this for ACE: cs.wustl.edu/~schmidt/ACE-overview.html
 
Xeo
Ah, right
 
Never heard of it though
 
I thought ACE was some ancient library
 
5:24 PM
Haha, the smart pointers battle left auto_ptr in ruins
@Grizzly Oh OK
 
where can i talk to a few moderators
 
SO: question. How can I get those codeblocks into text?
 
Alexandrescu Castle looks like a place where compilers go to die
@bamboon Four spaces
 
Xeo
@KerrekSB Hm, then the C++98 border doesn't make sense.. :( final and override are C++11
 
@Xeo Indeed
Cartographers err, you know...
 
5:25 PM
Those are probably infiltrators ;)
 
Xeo
@KerrekSB Well, his Loki library along with Boost was a major test for compilers. :)
 
SO... the VI mountains basically say "this is all pure death, apart from one diamond mine"?
 
Xeo
I love the diamond hierarchy reference
 
@Xeo Ooh, d'oh - I missed that!
 
@KerrekSB yeah but what if I want to get them into written text like: this is cool stuff std::string bla blub. The std::string should look like a code block. I hope you know what I mean
 
5:27 PM
@bamboon backticks, a.k.a. grave accents
 
Xeo
@bamboon `std::string`
Is what you should write
 
The little lost goto is nice. May it stay lost forever or something like that
 
Xeo
Memory management desert
Apart from a few errors, that map is awesome
 
@drunkMonk most people in this room have some low level moderator access, e.g. vote to close + 10k tools
 
The long long is really quite long.
 
5:29 PM
@KerrekSB ah thank you very much. I tried 'std::string' but it didnt work
 
What's std::power for?
@bamboon Those are apostrophes :-) They're far too common to serve as escapers
 
@awoodland could you please look into the following question: programmers.stackexchange.com/questions/129354/…
was closed ..
but i think its quite interesting after the edit
would be interesting to see the responses to the questions
@awoodland i think it deserves to have another chance
 
Where and how should I install the libc sources under Linux (Debian/Ubuntu) so that gdb finds them?
@Xeo Cool. It'll be nice to have.
 
@drunkMonk we're off-topic discussing that in this room, but I made another room if you want
 
5:36 PM
@KerrekSB I think you can put them wherever and point gdb to it. source may be the command for that.
Oh wait, no, source is for running a script.
 
@LucDanton I'd prefer a solution in the spirit of the distribution, though perhaps Debian doesn't have a notion of source code
maybe /usr/src/?
Then again, I don't even know how to get the source code! It's not a regular debian package, and it's also not avaliable through apt-get source...
 
@kerrekSB does the package have a homepage field set in control fields?
 
5:52 PM
I believe the package is libc-bin, and there's a virtual package libc-dev and libc-dbg (which do nothing)
Oh, apt-get source libc-bin does work :-)
It's fetching eglibc
What's the font in the C++ map?
OK, so I have a directory eglibc-2.11.1 now. Where should I put it so gdb finds it automatically?
 
> When you start gdb, its source path includes only cdir' and cwd', in that order. To add other directories, use the directory command.
 
@LucDanton Oh, neat.
 
Xeo
6:08 PM
0
Q: C++: Const correctness and pointer arguments

BenI understand that a const pointer can be declared a couple ways: const int * intPtr1; // Declares a pointer that cannot be changed. int * const intPtr2; // Declares a pointer whose contents cannot be changed. But what about the same principles within the context of function arguments? I would...

Sigh
 
I hate it when I'm trying to find why my code is slow, try to make a SSCCE, and the SSCCE runs 3 times faster.
 
will this code actually work?
according to the author it defines different function overloads based on how many times it is included.
 
you can find better references on "X macros" and the boost::preprocessor library
it will technically preprocess, but whether or not it's a smart idea is another matter
as with any other preprocessor (ab)use, you'd better be damn certain of what you're doing with it
 
It's actually meant to confuse the maintenance programmer.
I found at over at the hacker's choice
 
Xeo
 
6:13 PM
then yes, it will work and serve it's intended purpose
 
Xeo
The fuck...
 
You know what, I'm starting to think the preprocessor is dangerous.
 
@IntermediateHacker oh yeah
template std::vector<myclass>; should force the compiler to instantiate all members right? GCC is complaining error: expected unqualified-id before ';' token
 
You know, this can help me out while asking questions at SO.
 
Can I give gdb a permanent input history?
 
6:26 PM
Input as in the commands you give to it, or input to the program being debugged?
 
@LucDanton The command-line input that I type into it
like directory /really/long/path
 
Alternatively, you could use .gdbinit for that.
 
@LucDanton That's the smart answer :-(
or break really_long_but_specific_function
 
What's that called? The XY problem?
 
@LucDanton Hehe. You don't out-XY me! :-)
I like to linger on the pre-automate part of the geek curve sometimes
Also, the relevant source files are in thousands of subdirectories; can I include them all recursively somehow?
 
6:31 PM
I think normally the debug information puts a path rather than just the filename. So if the program has paths foo/source.c and bar/source.c as source files then you'd only need to point to the root of both foo and bar. Is that the case?
 
No, alas not.
 
That sounds bad.
 
E.g. rtld.c is in elf/, and libc-startc. is in ... well, in three directories, actually
What's worse is that even with the code in place, the function arguments still appear as "optimized out"
So while the standard library ships with debug symbols, there is no separate debug build.
 
Well debug symbols are really useful regardless of the build :)
I'd use them all the time if not for the fact that it breaks with LTO (and I use that on non-debug builds).
 
Xeo
Okay, obiously this question just got posted somewhere known. I got 5 upvotes in less than 15 minutes
 
6:38 PM
@LucDanton They're useful, no doubt, but they don't allow me to trace optimized-out function arguments though the CRT startup...
 
@Xeo you want more?^^
 
Xeo
@bamboon Nah, I already repcapped for today. I was just wondering where it's posted.
 
6:49 PM
@Xeo Not just you, I got 7 upvotes over a 24-hour period on my loop answer. It's only been averaging one per day for the past 2 weeks.
As well as two random upvotes on a very old answer which gave me the "Revival" badge...
@Xeo Oh... it's past 40! Congrats your first Guru! :)
 
@Mysticial Everybody needs at least one loop answer in their lives...
 
Xeo
 
@LucDanton Hm, well, I posted it as a question...
 
@KerrekSB I'm quite surprised that one isn't on the SE Hot Questions list...
 
@Mysticial What's the "hot questions" list?
 
6:55 PM
@KerrekSB Click on the "StackExchange" menu on the top left.
And have an upvote too... maybe that'll help push it up.
Getting to the top of that list is almost a prerequisite to for getting a 40+ answer...
The only other alternative is Reddit...
 
@Mysticial Oh, that one - well, it'd have to compete with classic questions like this one...
 
@KerrekSB Yes, unfortunately. IIRC all of my 40+ answers spent several hours #1 on the top of that list.
 
there are some seriously strange SE sites
 
@bamboon "Parenting" and "Biblical Hermeneutics"?
 
@KerrekSB yeah, those are one of them^^
how senseless is it to discuss about that
 
6:59 PM
Xeo's compile-time 1+2+3 answer never made it to #1 on the list, but it did hang at #2 or #3 for a few hours. That's good enough.
 
J.K.Rowling never thought of such things
 
I have one on Gaming...
 
who is actually paying for all these SE sites?
 
skeptics can be quite fun
advertisers, who else?
the SE network is way too big, and free, to be paid for by anything else
 
I thought there is no ads on SE?
that is why I am wondering
 
7:13 PM
wow... I just got another vote on my loop answer. It definitely got linked from somewhere...
 
there are
just not many
 
Especially after you pass 200.
 
well ad block plus takes that burden for me
 
I barely remember those sub-200 days...
 
-1
A: What would be needed in C++ so that we can always use references and never pointers?

hypercodeI have reassigned C++ references using code like this: struct EmptyType {}; const EmptyType Null; template<typename DataT> class DynamicReferenceT { union { DataT & _ref; DataT * _ptr; }; public: DynamicReferenceT(DataT & r) : _ref(r) { } void...

Awh Hell NO!
 
Xeo
7:17 PM
@Xaade lol on the union. Why the fuck not just a pure pointer?!
 
Hmm, am I still a duck? Apperently. When does my name/pic update after I change them. Do I have to disconnect?
 
Xeo
@Xaade Ha, it's even ill-formed according to the standard. :)
 
@MooingDuck You are on my end.
 
Xeo
Interesting. Since I hit repcap, no more upvotes on the sum answer. :(
 
@Xeo That's usually a good thing so you can "hope" the come after the rep-cap resets. :)
The exception is when the question is very new, and you want it to get bumped as high as possible on the SE Hot Questions list.
 
Xeo
7:23 PM
@Ambeco Gravatar takes a bit to update your picture
Or rather, the site caches
 
@Xeo it's updated in the lower left corner here, and when I refreshed my SO profile. Just not in the lounge as far as I can see. Which is fine. I just wanted something less unprofessional.
 
@Ambeco Less professional than a Psyduck? XD
 
Does anyone here have any good reference books or tutorials on rs485 serial programming in Windows using C++?
 
@Mysticial less UNprofessional = more professional
 
@Ambeco Oh right... double-negatives...
 
Xeo
7:26 PM
@Ambeco: Seems updated now after a refresh
 
Or sample code :)))
 
Xeo
Anyways, @Ambeco, many of us here got Anime / Manga Characters as their Avatars. Unprofessional? Maybe. What I like? Absolutely.
 
I'm pretty sure my avatar is more professional than my face.
3
 
It's not unprofessional unless you work here!
 
@Xeo Someday I'll come up with an avatar for myself that I like.
 
7:28 PM
@Ambeco me too
hi
 
Xeo
Ah, that sum 1..1000 question is #3 in the SO newsletter
 
@Xeo SO newsletter? What's that?
 
Phunny. The chat says:
Soooo, you're Mooing Ambeco or something?
 
@sehe Mooing seemed childish so I just changed it, chat seems confused. I'd had that name since I was.... 13?
 
Chat just caches until page reload.
 
7:31 PM
hi. quiz
please explain how this works!
struct A { A(initializer_list<int>); }; A a{{1, 2, 3}};
 
I liked Mooing Duck. It had character. It's like Neil Butterworth - he had something else before that - very recognizable. Ambeco sounds like an insurance company :) (I hope I don't insult you if that's your real name haha)
3
@JohannesSchaublitb can we assume it should work/does work?
 
@JohannesSchaublitb it shouldn't
 
@JohannesSchaublitb Is this a struct with an anonymous member or something? :)
 
@sehe I made it up. MooingDuck did have character though, I might change it back
 
@JohannesSchaublitb ah, didn't you post that as a bug report to gcc earlier today?
 
7:33 PM
@sehe Is Mooing Duck gone forever?
 
@sehe eh, fine. Nobody is going to hire me for answering questions well anyway :D
 
@JohannesSchaublitb {1, 2, 3} has type initializer_list<int> and you're using list-initialization syntax with direct initialization.
 
Nobody is going to hire me for answering questions. Period
 
@FredOverflow for at least 30 days I guess, can't change it back now :(
 
hi
 
7:34 PM
@Ambeco They might hire you for answering interview questions well.
 
@Ambeco Ah, so you just changed your name.
 
cpx
@FredOverflow I think its weekly newsletter containing links to top questions.
 
@Ambeco a mod might be able to help out if you could think of pressing reasons (like, a not from your psychiatrist stating that you are beginning to suffer from dissociative symptoms)
 
@sbi: is your name short for "safe bool idiom"?
 
cpx
7:35 PM
@FredOverflow link
 
@sehe not like I randomly changed my name and then randomly changed my mind?
 
@KerrekSB Haha, I was about to ask that.
 
I'd try it if I really did change my mind. However, some of us have had sullen screen names all the time (sehe?) and it didn't matter much.

I think
 
@RMartinhoFernandes hey robot
 
@cpx Why would I want to change my profile?
 
7:37 PM
Hey.
 
@cpx borken link
 
@cpx The "Agricultural and Mechanical College" is now hosting academic linguistics?
@sehe It's spelled "borked".
 
@KerrekSB specializing in linguistics for PEASANTS!
@KerrekSB Sorry
 
@sehe it was a link to edit FredOverflow's profile.
 
@Ambeco I saw that. It was way borken
 
7:39 PM
@sehe works fine if you have proper permissions
 
@Ambeco I do have proper permissions
 
@sehe to edit his profile?
 
@KerrekSB (it's peanuts really, not the regular bread-and-butter)
@Ambeco No? Just, very proper!
 
The "Hey, why not throw in a singleton in a totally unrelated place" guy replied. stackoverflow.com/a/8799914/46642
 
2
Q: What would be needed in C++ so that we can always use references and never pointers?

Stefano BoriniAccording to what I found on the net, you should use references as much as you can, except when you must use a pointer. As far as I understood, the only reasons to use a pointer are: when dealing with raw memory or when you may have to return null or when you are dealing with the returned new...

What a strange question. I've added a comment.
 
7:41 PM
@Ambeco Well, you could point at the starred messages and have them verify you starred that message about the insurance company... :)
 
cpx
@FredOverflow There's a checkbox on the right which says "Send me the weekly newsletter".
 
@RMartinhoFernandes I still don't get LR parsing
 
@FredOverflow Nitpick: it's ref T.
 
@Feeds lol @ the concepts shipwreck :)
@RMartinhoFernandes thx corrected
 
how is shifting and then reducing any different to simply unifying branches, and then parsing as LL?
 
7:46 PM
@DeadMG What do you mean with "unifying branches"?
 
@FredOverflow I liked the diamond mine :) Made me think for 10 seconds what it referred to. The rest is a bit to explicit (hah, pun intended) for my taste
 
@sehe What is the diamond mine supposed to represent? Diamond of death?
 
@FredOverflow Virtual inheritance! Woooooh
 
@FredOverflow Solve the dreaded diamond?
 
7:50 PM
Right next to
□ I sell my soul (going rate: $0.00)
 
@sehe Your soul is only $0.00? :)
 
@Mysticial Nah. I didn't check the box. I venture it'll be worth something, once
 
@FredOverflow: How did CWC work?
 
@DeadMG LL parsing works top-down, but LR parsing works bottom-up.
 
hey now
 
7:53 PM
I've read those terms a hundred times, but I still have no idea what it means when it comes to "I've got this class and a parse() method and what the hell goes here?"
 
anybody know anything about statfs?
 
@sehe I was sad that location seemed arbitrary
 
sorry man
must be a big delay over here, i sat and waited for a minute before posting
 
@sehe
what do you guys think! is my testcase valid code!?
why is it valid
 
7:56 PM
It didn't compile. yet. Must have copied/pasted wrong. I'm doing stuff :)
 
1
Q: Could operator overloading have worked without references?

FredOverflowAccording to Bjarne Stroustrup, references were introduced into C++ to support operator overloading: References were introduced primarily to support operator overloading. C passes every function argument by value, and where passing an object by value would be inefficient or inappropriat...

 
@DeadMG With LR, you start from the leaves and continuously match them to "higher" productions until you reach the start symbol.
 
@JohannesSchaublitb No... it was missing at least 5 characters (std::) as well as #include <initializer_list> (on gcc 4.6.1), which, I'm sure wasn't your point :)
 

« first day (451 days earlier)      last day (4488 days later) »