« first day (398 days earlier)      last day (4548 days later) » 

12:00 AM
@Christoph Ah, that's true. Inconsistencies across different TUs don't require a diagnostic.
 
@Christoph - I think there might be an exception explicitly to the rule you quoted:
§6.7.5.3/15 - "compatibility and of a composite type, each parameter declared with function or array
type is taken as having the adjusted type and each parameter declared with qualified type
is taken as having the unqualified version of its declared type"
 
@awoodland: it seems you are correct, which would be pretty embarrassing on my part (I only skimmed the rest of the paragraph when it started talking about old-style declarations)
let me re-read the paragraph a few more times ;)
 
12:18 AM
@Christoph it's chock full of exceptions and special cases that whole section
(which is pre-C99)
 
@awoodland You'd get 100 USD if you can save my "aside tip"!
(USD = Unit of StackOverflow Disquisition) (edited)
 
12:31 AM
well, at least to me it seems that I was wrong; I had a specific case of incompatible types in mind (void* vs char*) and was unaware of the relaxation of the compatibility rules in case of qualified types (which is, incidentally, only mentioned in the very last sentence of section 6.7.5.3)
 
@Christoph I suspect a committee meeting might have spent quite a while arguing about it
 
indeed, for a long time I was under the impression that const *restrict arguments were guaranteed to never be changed by the callee (they are not), which would somehow loose a lot of its attractiveness if you could legally cast away restrict
as I was wrong about that as well, there's no reason for me not to be wrong again...
 
I know very little about the restrict keyword other than it isn't in C++11, presumably because the complexities of making it work with references and rvalue references is rather large
 
12:45 AM
@awoodland: found my comment where I explained about restrict (modulo lifetime considerations):
if an object is (1) accessed through an expression based on a restrict-qualified pointer and (2) the object is modified, then (a) the pointer must not be const-qualified and (b) all access (including the modification) must be based on that pointer; in particuar, an object pointed-to by a restrict-qualified pointer-to-const can't be modified at all (during the lifetime of that pointer), but only if the pointer is used to access that object
it only makes callee-side guarantees (because the caller can't know if the qualified pointer is ever used), so losing restrict on a parameter has no effect on caller-side
 
@Christoph does the upcoming C standard discuss the possible interactions between restrict and threading?
 
@awoodland: doesn't seem to be the case; however, I don't think restrict adds anything to the mix which doesn't already have to be considered for regular pointers
anyway, I'm done for today - good *, everyone...
 
1:19 AM
Oh, thanks both for hashing this out!
What's the answer in the end? OK or not?
 
1:33 AM
@CatPlusPlus close throws because it throws on every platform: it flushes the I/O buffer and that's risky business. In C++ close throws but ~basic_filebuf hides the exception (27.9.1.2)… is that really any better? I don't know. If you care about robust I/O in C++, you therefore need to close in advance.
 
2:04 AM
if you want to handle the exception, maybe, you need to close in advance.
close() does not make I/O any more robust. unless you actually need to handle the error for some odd reason, it just means you don't trust RAII.
 
I hacked on GCC's filebuf implementation a while back… I forget the details, but iostream is sometimes a bit ambiguous about what happens after an I/O error. Being able to retry a failure or retrieve the possibly-unwritten data are effectively optional features, and iostream is essentially not for truly robust I/O, at least not GCC's version.
Anyway, handling the error is certainly necessary for robustness.
 
morning
 
if an error occurs during closing, you're pretty well screwed anyway.
 
@DeadMG MorninG
@cHao You can stop and try again, or attempt to put the data somewhere else.
 
you couldn't really try again; if closing failed, the file would still be open and in some indeterminate state
you couldn't reliably do anything with it, even reopen it.
and putting the data somewhere else isn't your job -- it's the caller's.
 
2:16 AM
@cHao The file is open, therefore you can try again. It's up to the implementation to define the state, along with the types of I/O errors beyond "std::ios::failure was thrown".
@cHao std::filebuf is designed to be inherited from, and it's the derived class which has access to the buffer and the responsibility of doing something with the data, and interpreting the kind of failure.
 
...
the stream would basically be in some "failed" state.
if you have any concerns at all about being able to compile elsewhere, you don't even know what that state is.
 
I'm not saying there's a portable solution using an instance of std::basic_filebuf, just that it's reasonable to want some conventional protocol for subclassing filebuf to interface tighter with the underlying filesystem and the calling program to really handle all errors.
I/O robustness and portability do not go hand in hand, but if you're programming a spacecraft or military hardware or something, you probably don't port often for that very reason.
 
if you're programming a spacecraft or military hardware, you're probably not using c++ to do it.
regardless of what its fans say.
software like that has very strict requirements, like "no exceptions", "no dynamic allocation" or even "no stack"
it has to be entirely predictable.
 
Requirements like that are ultimately dictated by the requirements of the task at hand. You're not really going to implement autonomous navigation and machine vision with no stack.
C++ is a high-level language and high-level features can still benefit from it. Anyway, any language I/O spec should provide for the possibility of a robust application, and C++ doesn't fail utterly, it just leaves things more ambiguous than it should.
 
2:33 AM
depends on how you define "robust". if it means no data gets lost, ever, then no -- that's unrealistic.
if it means you know when an error happens so that you can try to fix it, sure.
but i/o is inherently unreliable. to expect 100% reliability from the standard libraries is asking too much.
 
What other alternative is there? If something is physically possible, the language should allow it. The data may physically need to disappear somewhere, but it doesn't need to be inside filebuf.
And don't get me wrong, I'm just remembering from ~18 months ago, but filebuf does allow for leaving the buffer in a state where only data that wasn't confirmed written is kept, but that really should be a requirement.
 
it very well could be. if the error happens while flushing, where else would it happen?
 
It doesn't make things any slower or memory intensive.
 
it's not required because in some cases it just isn't possible.
 
You call the filesystem's write and you get back a count of bytes that were actually written. Those bytes can be thrown away. Other bytes must be kept until the destructor is called. It's not complicated.
For objects of type std::filebuf, you can't reach those bytes. But a derived class can.
 
2:41 AM
but there's no requirement that write be called...and even if there were, if an error occurs during the write, it returns an error code, not a number of bytes. go C.
 
write is a platform function, not C. You're thinking of fwrite.
 
there's no such thing as a "platform function" in c++ that i'm aware of.
 
Whatever. I need to go do things for today.
 
much less a guarantee about how it would work.
later :)
 
 
1 hour later…
3:47 AM
9 hours ago, by jalf
Hey @StackedCrooked, how's BG&E coming along? ;)
^ @jalf It's Friday today. So I'll start tonight :)
Dammit, woke up at 4 am again. And for once I went to bed early.
 
@awoodland google didn't. DejaNews butchered themselves, or rather (IIRC) the new management did. Google in a way rescued the archive. but then Google started doing Bad Things with it, like invalidating all article links worldwide overnight, and spamming the newsgroups (like 98+% of all that spam originating with Google), and sabotaging signature markers, and blurring the lines wrt. Google Groups, and so on and on. The latest, this year, that they're dropping references, sabotaging threading
 
Google is becoming a real bad boy.
 
cpx
4:05 AM
hm oh its friday again! it seems to come too soon in lounge.
 
4:51 AM
talk about ugly user interface. My apps seem professional compared to this:
 
user562566
I disagree, I think that interface is cutting-edge.
 
@AscensionSystems good for you.
 
user562566
Yeah looks top quality where can I buy it?
 
It's free. (probably bec. no one would buy it err... except for maybe you)
 
user562566
lol the website is even more of a disaster than it is. I was being sarcastic btw.
 
4:54 AM
I see. lol.
 
perhaps the developer thinks transparent menus are "cutting edge", but he forgot he had already made a normal menu.
 
That "cutting-edge" enough for you?
 
wow. that's cool. is it free?
does any IDE implement it?
 
It's a research project.
There are no public bits so far.
 
4:57 AM
damn. I hate research projects that don't go public.
 
This: msdn.microsoft.com/en-us/devlabs/debuggercanvas appears to be a spin-off from it.
> Debugger Canvas is the result of a collaboration between Brown University and Microsoft, integrating ideas from Brown University’s Code Bubbles project into Visual Studio.
Not being a big fan of mice, I'm not sure I'd like to use it.
 
trust microsoft to get their hands on every damn good thing. and then ruin it...
 
I actually like the Debugger Canvas idea more than the original idea of an IDE.
And then there's this abomination:
 
5:29 AM
@IntermediateHacker I've seen worse.
 
6:34 AM
@StackedCrooked looks like a starved pikachu
 
Found it!
The stoat (Mustela erminea), also known as the ermine or short-tailed weasel, is a species of Mustelid native to Eurasia and North America, distinguished from the least weasel by its larger size and longer tail with a prominent black tip. Its range has expanded since the late 19th century to include New Zealand, where it is held responsible for declines in native bird populations. It is classed by the IUCN as Least Concern, due to its wide circumpolar distribution, and the fact that it does not face any significant threat to its survival. Etymology The root word for "stoat" is likely ei...
 
7:01 AM
@RMartinhoFernandes Duct tape on his face?
 
@StackedCrooked it's a squirrel, and a children's song?
 
A children's song is not an animal.
@StackedCrooked Seems so.
 
7:17 AM
@RMartinhoFernandes That seems to be correct, but why are you posting a tautological sentence?
 
Because it's the truth!
Would you rather have me spreading lies?
 
7:35 AM
hm
 
7:51 AM
Can alias templates be specialized?
 
Any reason to why not?
 
5
Q: Alias template specialisation

Tomalak Geret'kalCan alias templates (14.5.7) be explicitly specialised (14.7.3)? My standard-fu fails me, and I can't find a compiler to test on. The text "when a template-id refers to the specialization of an alias template" implies yes, but then the example appears to refer to something else, implying no. N...

You can work around it with a class template that does the specializations, and the alias aliases to the type member of that.
 
I appear to have just posted an answer as Community Wiki. How weird.
 
Accidentally?
 
7:58 AM
I guess so.
 
Quick, delete it and post again!
 
lol :)
 
cpx
> Yank has invited you to Developers Home.
Hm, did anybody else get an invite? or is it me? spam?
 
Is that a notification bar on the chat?
If so, that's an invite for another room.
Whether it's spam or not is yet to be seen.
Do you know Yank?
 
i got invited too....ignored it
 
cpx
8:03 AM
I had it in inbox as well.
@RMartinhoFernandes nope
@cHao oh
 
Maybe it's someone trying to advertise some silly new room that has sanity.
 
what would be the point of that?
 
> 10 all time messages
@cHao No idea.
 
8:59 AM
oh hey, they fixed my Connect bug
of course, I won't actually get to see the fix until VS11
 
@jalf Yeah, good joke.
@jalf Oh, that makes sense.
 
"we made a fix, and you can't have it. Screw you"
 
Dammit, these input loops testing eof()/good()/etc are all over the web.
Get ready to be disgusted:
3
Q: Is "Value Validation in Getter/Setter" good style?

Charlymy Getter/Setter methods check the value, before they set/return it. When the value is invalid, they throw an exception (BadArgumentException or IllegalStateException). This is needed since we initialize all members with invalid values - and so we avoid working with these invalid values ( == gett...

 
9:39 AM
I'm going home
to see my puppy!
 
@DeadMG oh is your profile pic actually your puppy and not some generic internet puppy picture?
 
yes
that's actually my puppy resting on my arm
 
@DeadMG that's kinda cute. I have a suspicion the moment we buy our own house we're going to end up getting a dog too
 
dogs are like children that never really grow up
they're cute, and stupid, and can be hard to control, and lots of good fun
it's a pity though because I don't really want to meet my family
 
10:03 AM
using declarations breaks the law of encapsulation?
 
class foo
{
    public: int a;
};
class bar : private foo
{
    public: using foo::a;
};
 
lol..... the internet is full of idiots
 
@IntermediateHacker rofl :D
 
Argh, I just encountered a Singleton in an old codebase :(
 
10:11 AM
Hehe.
 
@FredOverflow better than encountering one in a new code base, though?
 
Why are you running repeats?
 
running repeats?
 
(Also, if you post the XKCD permalink instead of a direct link to the image, you get the tooltip for free.)
 
10:19 AM
@IntermediateHacker The last two pictures were posted here by someone before.
A few days ago.
 
oh.. dammit.
what about this one?
 
Xeo
Mornin' guys
 
@RMartinhoFernandes can u move the last two pics to the bin?
 
you can do that?
 
10:21 AM
@user411102 I don't think that's really a problem
 
@DeadMG I can play ping pong!
 
ah , the cool things room owners can do...
 
Xeo
Always learning new things, eh?
 
1 message moved to Sandbox
 
cpx
hmm
 
10:22 AM
got it
 
@user411102 sort of related: gotw.ca/publications/mill02.htm
 
1 message moved from Haskell
1 message moved to Haskell
 
we can steal messages from other rooms?
 
1 message moved from Haskell
@DeadMG I'm a owner on both.
 
OIC
scumbag
 
10:24 AM
:P
 
I think I've developed an inferiority complex of room owners...
 
cpx
how come i never got booted from C# room?
it has been two hours since i had left
 
"booted"?
@cpx Did you press "leave"?
 
maybe u got garbage collected.
 
cpx
no, closed the window just
 
10:26 AM
Closing the tab doesn't leave the room, unless it's the last chat tab open.
 
My history exam required two references, but my system was out of memory, so when the examiner type-checked my exam, he returned an EXIT_FAILURE.
 
You failed a class about dead people?
 
who wouldn't?
dead people can hardly come up with new ideas
 
I got 76%, but that's close to failure in my dad's view.
I hate History by the way. It's completely useless
 
join the fucking club
 
10:32 AM
lol.
 
makes me rage all that time I spent in school
analyzing the language of dead guy poetry or some other bullshit
 
Xeo
@DeadMG I'll join too.
 
@Xeo a fucking club? Sounds... interesting
 
why in the world do all messages containing "fuck" get starred???
 
you two have fun
2
 
10:33 AM
@IntermediateHacker All but that one :P
 
@jalf: not without you, honey
 
Xeo
My vote for the dumbest question today goes toooo....
0
Q: How much does the dot operator affect efficiency?

user965369How much does using the dot operator to access some data cost speed-wise? Eg: struct A{ int a = 0; }; int main(){ A obj; int b = 0; cout << obj.a; // How much slower is this cout << b; // Than this...? return 0; } I know I should b...

 
@DeadMG That's stuff from History class?
 
technically speaking, it was English
 
10:34 AM
lol.
 
but it's basically the same thing- ideas from after 1650 forbidden
 
Damn, I just wrote C+111 in a comment.
 
future compatibility...
 
yeah, if C++ has a new Standard, they'll have to start using four-digit years
imagine if there was a new C++ in 2111
 
Won't WideC kill C++ before that?
;)
 
10:37 AM
oh yes
deadder than a dodo
if I don't fail out of university and have to get a job washing pots first
 
@AlfPSteinbach What's up with that?
 
??? what's with the graph?
 
probably stock markets
 
Food markets!
 
10:42 AM
rate of people getting laid
but seriously, what is it?
 
I'd expect that as there are more unemployed people, and they have nothing better to do, the rate of people getting laid probably goes up in a recession
 
And they get drunk more often because they're unhappy. That helps too.
 
also, I hate university
 
I hate high-school, can't wait to get in university.
 
10:47 AM
it's just the same thing
they list topics, you take exams on them in the order they specify
the only difference is you get to pay for the privelege
 
Good day all
how goes it?
 
fucking terrible
 
oh jeez
 
How do you get an invitation to join this chat room added to a thread? Or is it always "room for X and Y" that they automatic move to chat inserts?
 
I'm going to go home and see my family and I don't want to see any of them
 
10:48 AM
feeling sick?
 
except the puppy
 
@DeadMG I so know how that feels
 
also, as usual, I'm fucking pissed off at university
I want the whole lot of them to fuck off to another dimension and leave me to work
 
wow
even your parents?
 
I actually don't care for them all that much
 
10:49 AM
@DeadMG I see now. High School == University....
 
they're very different to me
 
@IntermediateHacker are you American?
 
just like everyone else, let's face it
 
@TonyTheLion no.
 
10:49 AM
that we're american?
@IntermediateHacker ok
so Highschool != University
 
and I don't trust them
 
you don't trust your parents???
 
there's something wrong with that picture...
 
not really
 
10:51 AM
I don't get it. Is HighSchool and University different in the US?
 
well, the thing is, they sure don't understand the way that I think
my mother is a neat freak, for example, which I am most assuredly not
 
What does that mean? She's always cleaning stuff up?
 
I ain't a neat freak either, but both my parents are
 
no
it means she gets really pissed off at me and takes it personally when I'm not as neat as she is
 
oh
my parents gave up trying to make me as be as neat as they are
 
10:53 AM
she's not happy to just let me be who I am
 
lol
hmmm, now that is annoying
 
I resent them, and I need them
it's not a healthy relationship
 
Well, my mom's a study-freak and tech hater. She thinks programmers == plumbers.
 
eh
I wouldn't mind if my mother thought that
 
@IntermediateHacker What does that mean?
 
10:55 AM
I don't know about where you live, but over here, plumbers are skilled, wealthy people
 
Plumbers do stuff. Important stuff. Not all like marketeers.
 
And a hypocrite, cuz she hates it when I don't study and spend my time on the internet, while she does facebook all day long.
 
plumbers plumb
 
and software houses and plumbers are both famous for the "ooooh that's gonna cost you mate" thing
2
 
but finding a good plumber in the UK is another matter
 
10:56 AM
@IntermediateHacker But she doesn't have study, does she?
 
also
I feel very disappointed in my parents, and my previous teachers
 
I really believed that university would be different and that I could learn independently there
and it's been a nasty, big, disappointment ever since I got here
 
@DeadMG I found it was
 
If you want to learn independently then teach yourself things, and don't go to school
 
10:58 AM
I could do that just fine
 
however it's then harder to get a job, as you have no degree
 
but if you want to get a job, you have to have their accreditation
 
but you've then only studied what you wanted to study
 
and they won't just look at your work and give it to you if it's good
 
yea, well, sometimes you have to make a compromise
I didn't go to uni, and yes finding a job is fucking hard, though I do always end up finding something
and it's not like I am entirely clueless as to what I'm doing
 
10:59 AM
well, I did two years and passed, and I get something for that
 
I've met Uni graduates that had no idea what a "stack" or a "heap" was
 
@Tony: Yeah, I'd give you a job, if I had a company.
 
meh
@DeadMG oh cool
 
actually, it's funny
I was just thinking about it, and I rarely see you discuss code
 
lol, true
well, when I'm writing code and I have an issue, I'll discuss it in here
or ask on SO
 
11:02 AM
so although I find myself feeling that I have at least some vaguely defined quantity of respect for your abilities, I actually find it difficult to pin down
 
@DeadMG I got a job before getting a degree from my (rather minor) open-source contributions.
 
my university certainly won't offer me a degree for any amount of work on WideC
 
@RMartinhoFernandes which project(s)?
 
@DeadMG oh, well I've asked plenty of questions on SO, and I have discussed code in this room. Also I can send you code easily that I've written
 
@awoodland I implemented some pattern matching on boo, and durations on NodaTime.
 
11:03 AM
well, I don't have a job to offer you, so don't bother with the interview :P
 
I know, just saying
hmmm, not sure that walking a fish is a good idea
maybe swimming a fish is more appropriate
 
anyway
time for me to go be even more incredibly unhappy than I already am
bye#
 
Bye. Have fun with your puppy.
 
SP6
11:35 AM
I had a quick question what does *(char *) equals in C. I was reading code regarding how to figure out the endianess of a system and they checked it by `int num =1; if(*(char *)&num == 1) print("Little");
 
@SP6 Do you know what (int)x does?
And what about *p?
 
SP6
@RMartinhoFernandes isn't (int) x for type casting and *p for derefrencing the value at p....
 
Yes.
Can you figure out what *(char *)x would do then?
 
SP6
sorry to sound like a noob, but is the x implicitly defined in the code i was reading?
 
@SP6 No, no, the x is just for example.
 
SP6
11:43 AM
so what exactly are we "AND"ing with num?
 
Ah, you don't know what &x does, then?
 
SP6
that points to the address of x
or to word it better "gives the address of x"
 
Yes, and the code does takes the address of num with &num, right?
 
SP6
umm..yeah!! WOw, dont i look like a retard now..
thanks man
 
@SP6 No problem :)
So, it takes the address of num, casts the pointer to char* and then dereferences a char at that address. It's a hack to get the first byte of an int.
 
SP6
11:48 AM
thanks...for some reason i kept thinking it was performing a bit wise AND operation
 
*.JPG is evil.....
anyway, including <iostream> just added a 1.2 mb disk-space overhead to my program. Is that normal?
 
but why? It's just IO isn't it?
I'm better off using <cstdio> ...
 
Will it add less?
 
@IntermediateHacker yeah, so you don't run out of disk space....
 
11:52 AM
More important, is the size difference worth using printf?
 
are you planning on distributing your application on floppy disks?
also, I'm guessing you (1) use a statically linked runtime, and (2) are looking at a debug build
 

« first day (398 days earlier)      last day (4548 days later) »