« first day (15 days earlier)      last day (4932 days later) » 

3:55 AM
@HostileFork yeah, but the main advantage of codepad and ideone is that you can run the code too; encouraging people to paste better testcases/examples
@GMan meta.stackoverflow.com/questions/27566/… (I had posted a dupe, linked to it, and I tend to paste that link often, trying to prompt that kind of improvement)
@HostileFork there's a feed for the starred posts, but the 3 pinned ones are long enough that the side display isn't very useful for me either :(
 
4:28 AM
@JamesMcNellis: for pinned items, I think we have to be careful of length; though I wish the UI was a bit better, since that seems the real solution
how are those?
Paste at codepad.org, ideone.com, or here if short.
3
 
Wow, no chat since I left? D: (Cept for Roger.)
 
I never count. :(
 
Haha.
 
What's all fuss about ? I'm trying to sleep here!
 
@RogerPate Noticed that too.
@wilhelmtell Shshsh, you're going to wake the other kids.
 
4:43 AM
:)
 
@GMan yeah, I'd really like to use that space for topical links (unpinned after a week? days? they're viewable in the history afterwards) and (at most?) one pin about the channel itself
I posted in chat feedback thinking if rooms should have their own wiki page... but that's really overkill; been thinking a SO.meta [faq] post ("How does the C++ chat room work?") would work for anything substantial, once someone writes it up
 
I wish so chat had threads, to make it easier to follow conversations. especially when interwined. :-S
 
it doesn't work at all for threaded conversation like a mailing list :(
I think this is mostly by design though
 
@RogerPate I'd design it so there's a tiny 150 character room FAQ under the rejoin room button/other rooms, that doesn't get cut-off. Then pinned links we find important like we have now, and then just stars. With bold delimiters between the three. (sorted by favorite count, not date)
 
a pinned item linking to a meta post just seems simpler than a new UI feature
many rooms probably don't need the latter, anyway
a way to hide/show "seen" pins (that works per-user) would be great
 
4:51 AM
@RogerPate Oh, ya.
 
Got it. :)
 
5:03 AM
it's much easier to get rep with the feed ticker here :)
 
lol
i was going to answer that one but i didn't fee like putting effort into it :[
By the way, if you need to fill in 15 chars for a comment you can enter the zero width space. It counts and doesn't effect your actual message.
 
yeah, I've been doing that for a while :)
 
Oh, k. :) I Just see those symbols there.
 
symbols?
 
One sec
Btw, did you know you're still in our old C++ room?
 
5:15 AM
haha, must be an effect of freezing; it's not in my room list and I think it's been hidden/deleted/whatever
 
Oh, I see it when I click your name in chat:
And w.r.t your comments:
 
you're listed in it the same way
I clicked went to the room and hit 'leave'
doh, it's a zero-width joiner, I think; what browser?
 
@RogerPate FF 3.6
@RogerPate Oh, weird haha. Left as well.
 
0
Q: Users listed as still in frozen rooms

Roger PateThe underlined room in the screenshot below is frozen and hidden, but GMan and myself were still listed as being in it. Manually going to the room (how to do that won't be obvious for most users) and leaving seems to work. When a room is frozen and hidden, should all users be automatically remo...

 
Thought you would report it. :)
 
5:34 AM
there's some deleted questions on meta I'd like to read, need that 10k ><
 
Ha, yeah. You're getting there, I'm at a measly 2.7k.
 
Good Morning.
 
@Arman I think you're mistaken. It's clearly night time.
 
no no, it's clearly 1:42 am here; that's enough morning for anyone
 
@GMan, its 10AM.
GMT+5 here.
 
5:49 AM
Nonono you're both wrong. It's 10:48 PM. Sillies.
 
10:48 AM, here in Pakistan.
 
No, it's 11:52 sheesh.
Not even the correct minute.
 
lol
 
lolzzzzzzzzzzzzzzzz
 
C++, the language the public education system refused to teach me anything useful about.
 
5:55 AM
Well, the general public generally doesn't need to know. :)
 
That Eiffel course I took in 2nd year always comes in handy.
 
6:38 AM
@RogerPate Good idea. I wasn't really paying attention to the pinned posts, but it makes sense to use them for "recent C++ news/announcements/awesome things/whatever"
 
Is this IRC based?
 
I log into my e-mail and find that over the course of the last 24 hours, someone added me to and made me an admin of a "C++ Enthusiasts" group on Facebook; now I have like 40 e-mails related to this... sometimes I wonder why I ever joined the site in the first place...
 
neat chat
 
@stanigator no
@JamesMcNellis: haha
I used myspace and use facebook to keep in touch with friends and family, but I rarely log in once a week besides when I get email notifications
 
I don't even know why a "C++ Enthusiasts" group is needed; I'd think the "Andrei Alexandrescu's Fans" group should be more than sufficient!
 
6:51 AM
the c++-faq faq will be fun
 
If people start asking questions over and over about it will we need to create a c++-faq-faq tag?
 
I was initially against [c++-faq], but I was willing to give it a try, and I'm starting to lean to it being useful
 
:D
 
Excellent.
 
@GMan: talking with you about your one self-answered question, I figured out my real objection is "fake"/"made-up" questions rather than anything else
been thinking about it since then
 
6:58 AM
What do you mean? Like, since I myself didn't face the question "huh? what's the copy-and-swap idiom?" you object?
 
and, specifically, that sometimes it really would be better to generalize into something not immediately applicable even in a Q&A form
@GMan: did I mention at the time that it's usually better to extrapolate from the specific than to interpolate from the generic?
well-presented, yet concrete issues seem to make for better learning to those unfamiliar with the problem
 
Um, maybe you did. I have a very poor memory, though.
 
whereas people that already know the issue — and already have several concrete instances in mind — find the generic agreeable, because they have a different POV
i.e. you wrote up the question and answer very well, but I probably overreacted because the attention it'd get would drown out what I'd find to be more useful to those still learning the idiom: 3-4 (instead of just one) good, short concrete questions
 
Hm, I see. So, for example, how would you ideally see the topic of "How do I manage resources?" covered?
 
I don't know; it wasn't that long, certainly no longer than an average GotW article. (I'm not saying that's a perfect length for an article, but it seems to work well, IMO)
 
7:05 AM
jjj: there's a special sandbox room
 
My name starts with the letter "J"
 
jjj
ok..^_^
 
@GMan: I don't know, tbh, it's quite a bit bigger than just c-a-s
ooh, a SU c++ question in the ticker
 
Damn, he made us put a blue circles on our avatar. :P
Yeah, saw that. And it is much bigger, unfortunately.
Man, I wish we could flag something three times, and it would automatically be removed.
 
7:25 AM
what is the automatic removal limit?
I not sure we should flag for just two messages, as here
 
7:36 AM
@RogerPate What do you mean?
 
we can ignore two messages which will scroll past and won't be that bad to have in the transcript
rather than requiring moderator attention to remove them
but I'm still figuring this whole thing out
 
Ah, right.
Do you think an option to hide a specific message (locally) would be useful?
We would not flag them, as they aren't exactly harmful, and just hide the noise.
 
might be more complicated and harmful than useful
 
Ah, k
 
e.g. is it a room-owner privilege only? would it be used to "ban" users?
ah, just locally could be useful
 
7:42 AM
Yeah, too slow to clarify :) room-wide would be way too much work and bleh
It could turn into a little tiny slit with the text "Hidden", akin to:
----------------------------------------------- Hidden -----------------------------------------------
that you click to unhide. Small enough slit to fit between messages as they appear now.
 
there's a few working on a largish userscript addon for SE chat, would be a feature they could include
chat about that is usually in the SO.meta tavern
 
Ah, that's cool.
I need to go there more.
 
I've mostly stopped, 3 different windows open just for SE chat (SO, AU, SO.m) is too much
 
yea
 
I need a better twitter client too, maybe something that posts on the desktop, in the bg
just realized each SE chat window seems to need twice as much screen real estate as xchat, for 1/10 the load
a lot more is packed in, which is interesting, but I'll need a minimal interface eventually
 
7:57 AM
yea, lots of whitespace.
 
the seamless uploading and one-boxiing is kinda neat
 
Nice looking desktop you got there. :)
 
though it's online forever; have to make sure you don't mind anyone seeing it 5 years from now
 
ha, yea. is it indexable, though?
 
they partner with imgur I think, which does make them public; but there's a ton to sort through
 
8:03 AM
ah. good to know, no embarrassing photos then
 
 
1 hour later…
9:30 AM
you have to love the allocator dance: typedef typename Alloc::template rebind<Node>::other RealAllocatorType;
 
9:54 AM
@sbi: have you started to think about what to put in the [c++-faq] wiki?
 
10:38 AM
@JamesMcNellis : Don't worry now you won't get any email notifications via C++ Enthusiasts. Have fun!
 
11:15 AM
good morning
 
 
1 hour later…
12:18 PM
if I work at it tomorrow and request a recalc, I'll hit 20k; not sure if that's something to be proud of or not
 
1:01 PM
Good morning fellow mortals.
 
good morning impotent one
 
Ouch.
 
hehe.
 
Maybe it's the morning, maybe I'm just silly today, but wtf ...
gist: 656567, 2010-10-31 13:09:14Z
try {
    std::vector<int> v;
    // gtfo of try, so we only catch the ctor's error
} catch (const std::bad_alloc& e) {
    // ...
}
// damn it, so now v's out of scope!
 
 
1 hour later…
2:25 PM
hello?
 
@wilhelmtell: that's just a problem with c++'s scoping; I had a post that compared it to python, but no idea where it is now
@wilhelmtell: however, vector's default ctor shouldn't allocate anything, so you can move v outside of the try and put v.reserve in it
 
well it's more of a general question. it's about raii, not vectors.
 
see show_square towards the bottom of stackoverflow.com/questions/1744070/…
 
i think the answer here is raii usually does what you want, but not always. usually you want to abort everything when you can't get the resource. but sometimes you can handle it in scope.
 
the way python handles it better is try blocks aren't their own scope
e.g. try { T obj; } catch (construction_error&) {} else { use(obj); } would be awesome, but just not C++
so you have to munge the c++ to do that, if the type even lets you
 
2:32 PM
in c++ they'd say put the else block inside the try block.
 
but I don't want to catch exceptions it might throw
 
but that means your catch also applies for that.
yeah.
exactly.
maybe it's not an issue with raii but an issue with exceptions in c++
 
you can use compiler-specific mechanics to allocate a byte array that's properly aligned, then construct it in-place, using a scope guard to guarantee destruction for exception safety... but how ugly
it's a scoping issue in c++
 
that's disgusting. i'm trying to solve this elegantly. that won't do.
i think i have to catch this in an outer scope.
which i don't like
 
char buf[sizeof(vector<int>)] __alignof__(vector<int>); try { new(buf) vector<int>(); } catch (...) {} scope_guard _destroy = destroy<vector<int> >(buf);
 
2:35 PM
because it's an implementation detail of the function, the fact that some of its raii objects may throw.
whoa
was dat
g++-specific?
 
2 mins ago, by Roger Pate
you can use compiler-specific mechanics to allocate a byte array that's properly aligned, then construct it in-place, using a scope guard to guarantee destruction for exception safety... but how ugly
it's the code for that :)
 
:-S
 
I just pulled alignof out of thin air, that's the compiler-specific part
google "scope guard c++" for a description of how that works
 
k
i am really surprised faq lite doesn't talk about this.
in the question "what if my ctor fails" they say "throw". that's it.
well thanks.
 
template<class T> struct Destroy : ScopeGuardBase { T* p; explicit Destroy(T* p) : p (p) {} ~Destroy() { p->~T(); } }; template<class T> Destroy<T> destroy(void* p) { return Destroy<T>((T*) p); } typedef ScopeGuardBase const &scope_guard;
 
2:38 PM
like, details, plz?
 
that's the scope guard bit
yeah, most c++ ends up with zombie states to deal with this problem
when that fits nicely, like an empty vector, fine, but otherwise it's just nasty
 
zombie means you've got to check everywhere for this shit.
:(
 
hmm, that Destroy needs a release method to not depend on copy-elision; anyway the article on scope guards should cover it
 
but, i mean, this is so basic! why do i have to dig into something so complicated? it's raii! it's basic of basic!
 
how will you be handling the exception? I take it bad_alloc was just an example there too?
 
2:42 PM
roughly what this means that you need to wrap every single function that uses raii in a try block. which is, roughly everywhere.
yes
the question is simple: in raii a ctor may throw. how do you handle it.
 
@wilhelmtell only if it can/should handle the exception
bad_alloc can rarely be handled, for example
 
you always should.
always.
 
not always
 
somewhere up the stack, you always should.
 
somewhere, but not in every function that uses raii
 
2:43 PM
otherwise you die.
k
 
one of the main reasons for raii is so that you don't have to handle this at every point in the call stack
 
but this is exception handling now, a different story. my philosophy is to catch as often as possible and then translate and rethrow as necessary.
yes.
but you see. here's a problem. you have an exception to handle.
maybe more than one exception.
 
sure, translate/rethrow if required; but if no translation is needed, don't even catch: let it propagate
 
i usually translate. almost always, in fact.
because this way it gives much more information to the upper stack
if you get a bad_alloc, what do you know?
next to nothing.
but if you get "network_cache_buffer_creation_failed" then you know a lot.
 
you can't handle a bad alloc every time you use a vector that would get tiring
 
2:47 PM
@wilhelmtell: I think we're just approaching it differently :)
 
@CiscoIPPhone yes. hence the issue. it's more than that. sometimes you can't, like i showed in my original snippet.
@RogerPate so you'd play with the compiler wires to fix?
 
what do you mean?
 
raii was supposed to be easy and simple. this defeats the whole purpose.
i mean you should an implementation-specific solution.
 
I rarely find the need to do this kind of thing, was just showing how it was possible
 
on creating a buffer and manually constructing into that, or something.
I think I should ask on so.
to see what creative solutions people have.
 
3:08 PM
k
 
3:18 PM
You've got 3 answers but I don't think they answer the question :/
I think you need to emphasize the scoping part of the problem
litbs answer would only work if the default constructor promised never to throw.
 
yes, litb gave the same answer I did, which is specific to vector
I used reserve and he used swap, but no real difference
 
3:41 PM
rvalue reference would be another way
in fact I think 0x features could solve this nicely:
Are you allowed to return inside a try?
assuming so you could create the object inside a lambda (with the try catch in there too). Having the lambda return a rvalue reference so you can assign it to the vector in the outer scope
 
@PrasoonSaurav It's no problem; I wasn't really complaining.
 
oh fuck.
it just hit me.
i'm teh stoopid.
 
Lightning?
 
of sorts.
umm. wrap the object in a raii object?
hit me now.
 
4:06 PM
0x question: if you did std::vector<int> blah = some_rvalue_reference;
does blah get default constructed first?
 
not unless you defined a copy constructor and that ctor called the default ctor.
(it's not clear yet whether you get a free copy ctor for move)
 
ah.
I was thinking you could do this: codepad.org/wIn3ICCi
 
I think it's simpler than that ...
Right now I'm in thinking mode. :-S but I think my question was stupid to begin with.
 
np. I was just playing around with 0x features.
 
I think Steve Jessop was the closest.
I think that if there's an error then I shouldn't touch that resource object anyway.
 
4:14 PM
true
pin tabs in chrome is useful, why did no one tell me about this!
 
 
4 hours later…
sbi
7:54 PM
@RogerPate Honestly, it hadn't even occurred to me that, when we introduce/hijack the c++-faq tag, that we will get a special tag wiki for it! While I think that the C++ tag wiki should very prominently point at the c++-faq tag (and its wiki), the idea of having an explicit wiki for the FAQs seems great to me.
The latest state of the FAQ discussion I know about is transcribed here:
http://chat.stackoverflow.com/transcript/message/65065#65065
To bad, now that my day is over and I have time to spend here none of you guys are available. @GMan, @Jerry, @James? (Just mentioning you all so you see the above, since Roger mentioning me made the SE popup on SO point me to his question to me.)
(That's a really nice feature of SE, BTW. If Jeff and Joel plan to take over the whole of organized discussion on the net, pointing out replies to me across forums from programming, to cycling, to cooking to parenting is a very big step into the right direction. Could turn out to be very addictive.)
Dull here. <stifles_yawn> I think I'll have a look whether there's any of that beer left in the fridge.
 
Can any body tell Is there any way to detect that a class containing vtable
I mean an object has a vtable pointer containing...I want to know this at runtime..
As for every object containing vtable always have 4 bytes added of vfptr(vtable pointer)
 
8:10 PM
I don't know a way to detect if an instance of a class has a vtable
 
sbi
@Hassan: There's nothing in the standard that requires vtables. They are an implementation detail usually sued for polymorphic classes. Why would you even care?
 
actually I want to cal functions on runtime which are taking objects as arguments.
 
sbi
What do you mean?
 
So If I need to call functions at runtime.. I need to make nameless block(created via malloc) and need to fill that block with appropriate data.
and then need to use assembler and this will target the call to function by using its address
 
sbi
No, you don't. In C++, you allocate using new.
 
8:21 PM
so if i would have vtable inside that object
I would allocate 4 bytes extra to malloc block allocated for object
 
So you're trying to make a class at runtime?
 
ok i'll use new.. both allocates objects .
yup..u got accurately
So as u know that in C++ theres no concept of reflection..u can't call functions at runtime.
if they are operating under objects as arguments
 
I don't know what you mean by "u can't call functions at runtime". foo(); // <-- calling a function
 
bro..
this is calling function at compile tuime...by writing foo.
I want to call functions at runtime..Suppose I have some gui on which all signatures of functions shown
I can select one of them
and can click execute after providing some data to it
 
I'd use member function pointers or boost function/boost bind
 
8:32 PM
ok that would give u addresses..
but u need argument's data as well
to pass fo calling function at runtime.
 
sbi
8:48 PM
@Hassan: Picking specific functions to call depending on certain conditions and passing the appropriate data to them is what programming is all about. We all do this all the time - and without creating functions at runtime! So from your description we can't see what your problem is. From what you wrote it certainly looks like a standard situation. You need to be more specific if you want any help.
(You won't get it from me here now, though, since I'll be afk now.)
 
9:03 PM
@sbi I'm half here. :-)
 
That would be difficlut for me to tell u exactly what requirement on which I am working in.
There's a complete specification of project for which I have to do some R&D's and other tasks.
in short I have to call functions with usage of assembly in C++
this caused runtime code to be invoked.
so this requires functions to be called at runtime with specified data
and data for every kind of parameter(whether primitives like BSTRs,DWORDS,floats,doubles,ints, shorts,strings and User defined objects.)
 
@Hassan The description you give is a bit vague.
Are you saying that you have to write assembly code that calls C++ functions?
 
yup
bcoz THERE's NO STANDARD AVAILABLE IN C++ FOR CALLING FUNCTIONS AT RUNTIME...
Unlike .NET there are no reflections standards defined
in rflections, u detect type at runtime and call function associated with that type.
but this is not the case in C++
 
9:21 PM
It's also platform-specific because there is no standard calling convention.
 
let say i have extracted calling convensions of all of those functions ...
say stdcall,cdecl,fastcall and every calling convension before call the function
 
Why can't you use a container that maps names to function pointers?
 
Let say I have determined the calling convension before calling function
problem is not using addresses or names of function inorder to call those functions properly
problem is to provide data set and feed that data set accordingly.
so that after feeding data we'll be able to call those functions accordingly with supplied data for its parameters
 
Why is that a problem?
 
just because of parameters (Which are Objects)
Objects of other classes
at runtime, making those objects and filling those objects with data
 
9:29 PM
I wish I could understand
 
Usually you either have a known, limited set of types that you can build for or you create a type that can hold anything, like a map containing string => value pairs
 
I can not explain here ..but I will try to send u ppl details bit by bit
:-)
Its a long story
I am developing Distributed AUTOMATION Functional Testing Framework
at windows level
which covers Windows EXE/DLL's and all binaries
to be extract and shown their details(aLl types an interfaces) on some Interface
and enable programmer to call those functions at runtime with providing data set for every function
 
Have fun
 
Use can engineer test cases by picking function's signatures one by one and can populate data set for all those functions and can execute those functions in a bunch ...
so that it forms a test case and that test case can execute.
after executing it tells that how much memory leaks,corruptions and other expected outputs he/she got
 
sbi
@JamesMcNellis Wow, I totally missed out on the feature of logging in by half! (Trying to avoid the obvious is-it-the-half-including-the-brain joke here.)
 
9:37 PM
@sbi: Nah; my brain half is busy with my favorite Sunday afternoon activity: debugging!
 
sbi
@James: Well, too bad, but it's past 10:30pm here, but feels like 11:30 (because we just switch back from DST to "normal"), and I have to get all the kids out the door tomorrow morning, so I'd better go to bed now.
Dammit, it seems I'll have to lure more Europeans into the "FAQ cabal" or communication will that to happen wholly without me. I just tried to recruit Johannes (http://stackoverflow.com/questions/4064286/c-const-keyword-explanation/4064308#4064308), but so far to no avail.
 
I don't think he's graced c++chat with his presence yet.
 
sbi
Mhmm, I thought linking works like in comments here?
 
It's supposed to. I have tremendous difficulty with the Markdown in here... I just kind of figure it's IE
 
sbi
Anyway, no, he hasn't been here yet. But I'm not even sure he's seen the mate question yet.
http://meta.stackoverflow.com/questions/68647/setting-up-a-faq-for-the-c-tag
(Just trying to drop it once in a while.)
Wow, now it won't even inline that link, even though it's on its own line!
 
9:44 PM
He hangs in #gamedev sometimes on afternet
 
sbi
@CiscoIPPhone: Never been to a chat, so that's merely babble to me. :)
I tried to go to bed with 37,000 rep tonight, even played a game with providing a sub-optimal answer (stackoverflow.com/questions/4065113/4065130#4065130), so I won't get too many up-votes for it, which even worked out, but then came that guy and accepted an older answer (stackoverflow.com/questions/4058052/4058089#4058089) and now I missed that. :(
 
sbi
@vinit: Hi.
And bye, since I was just leaving. :)
@James: Good luck with your debugging. See ya.
 
:) its fine
 
@sbi Good night!
@sbi You have 37,025 right now. Congrats :-)
 

« first day (15 days earlier)      last day (4932 days later) »