« first day (182 days earlier)      last day (4768 days later) » 

12:00 AM
@JohannesSchaublitb makes sense now :)
 
you can name constructors though. X::X where X is a class names a constructor
 
sbi
@GMan Once you've reached my age, you'll know that trying to convince people that you're right is only ever worth the bother if said people are open to argument and reasoning. :)
 
even though constructor declarations don't declare names
 
@sbi Yeah, I've found that out too, but I tend to think it's better to try and found out than assume not.
 
So you can try calling them wiith X::X() but the compiler will error out. "cannot call constructor" or something
 
12:01 AM
@sbi yep :)
 
Oh, look, @MehrdadAfshari is here.
 
sbi
@JamesMcNellis Well, you have to admit that VC has a bunch of silly warnings that you just have to trun of in rode to keep your sanity, but other than that, I'm all for using /W4.
 
sbi
@JohannesSchaublitb ??
 
@JohannesSchaublitb Say what.
 
12:02 AM
what.
 
@GMan wondering the same??
 
@sbi /W4 isn't too bad. /Wall is utterly useless though; include any platform or standard library header and you end up with thousands of totally garbage warnings.
 
sbi
@GMan Yeah, I, too, sometimes still fall victim to that fallacy. :)
 
@JohannesSchaublitb fame for what?
 
@JohannesSchaublitb Nm. You mean in like struct f { f(); }; f::f /* <- this is what you mean? */ () {}?
 
12:03 AM
fame for the lulz!
 
@JohannesSchaublitb haha lulz
 
@GMan yes f::f refers to the constructor functions
 
When @JohannesSchaublitb speaks, everyone listens, even if he makes no sense :-D
3
 
@JamesMcNellis true that! you can't ignore the template god :)
 
12:04 AM
@JohannesSchaublitb lol
 
i'm teh n00b
 
sbi
@JamesMcNellis I remember when, in one company I used to work for, we switched to a new VC version and suddenly were swamped with ~15,000 warnings. What a mess.
In the end we had the idea to setup a hall of shame. I had someone setup a script that parsed the results of the nightly build, folded repeated warnings (from headers), sorted the number of warnings by sub project, and posted that on the Intranet. Soon people fixed the warnings in their sub projects in order to get off the top of that list. When I left, we were down to a few dozen warnings.
@JamesMcNellis Sufficiently advanced knowledge is indistinguishable from magic!
2
 
@sbi and I worry about 1000 warnings in my current project ?!! pfff seems like I could just ignore them
 
@sbi so I guess I can conclude that having loads of warnings really isn't a good thing? :(
 
12:10 AM
I wish someone would fix this one so I could actually compile things. I have been unsuccessful in my quest to install an earlier version of libstdc++ under MinGW.
 
@JohannesSchaublitb Huh, I see.
 
@Tony Warnings should always be either (a) fixed or (b) explicitly suppressed with a comment explaining why the warning is wrong/superfluous/unfixable/whatever.
 
now some guy added range based for loop and nontemplate alias declarations to clang. I'm going to svn upmy clang and try them
 
Still no lambda expressions, though. That's the other thing that keeps me from moving to use it more frequently.
 
some months ago someone reported he has a "lambda implementation nearly ready for review"
but then he apparently never again said anything oO and there is a GSoC application for implementing lambdas.
 
12:17 AM
@JamesMcNellis hmmm so far I have failed to do that :(
 
sbi
@Tony No, because among 1k warnings you are very likely to overlook the one that points at a genuine problem.
 
@sbi oh damn, then I know what I should be doing the next few days...
I learned something again! Woot
 
sbi
Yay for learning! I gonna go to bed now, though. :)
 
@JohannesSchaublitb My code is always nearly ready for review if you use a sufficiently liberal definition of "nearly."
 
sbi
See you guys!
 
12:19 AM
lol
 
@sbi: Later
 
@sbi have fun
 
sbi
@JohannesSchaublitb Haha, I'm sleeping alone.
 
sleeping alone can be fun too
3
 
i'm sleeping with the compiler.
 
12:20 AM
@sbi see ya
 
=P
 
@Tenev should i be worried?
 
@sbi Cheers.
 
@Tony maybe =D
 
@Tenev lulz
 
12:22 AM
:( i have issues with the compiler :(
 
@Tenev Are you seeing another compiler on the side?
3
 
yes omg how did you know that
:P
pure fact
 
user image
2
i like that pic :)
 
Ha ha ha ha
 
That's awesome.
 
12:25 AM
i love it
i've lost the link to my post :(
 
Xeo
hm, which virtual machine do you guys can recommend?
 
VB
@Xeo Virtual Box works better than vmware
 
Xeo
@Tenev k :P
well, then I'll be off too. gnight guys and the still awake @sbi
 
@Xeo lol
night
 
@GMan i've seen you somewhere =D how much rep u've got in total?
 
Xeo
12:34 AM
@GMan well, he never goes to sleep the first time he says it :)
 
@Xeo yea lol
<- this much
(expand)
 
Xeo
not enough lines
:D
 
(expand!)
 
Xeo
like
 
sbi
@Xeo I'm not awake anymore, I'm already asleep!
 
12:35 AM
GMan, Washington, US
64.2k 7 105 219
 
aw damn.
 
Xeo
@sbi SEE!
 
^^ That much
 
O.O
 
@JamesMcNellis lol gtfo
 
Xeo
12:35 AM
 
Xeo
:)
 
O.OOOOo
 
Xeo
@Tenev You got many eyes there. You sure you're alright?
 
i have the troll-tags "pointers" and "arrays" in that summary. that's no good
 
12:36 AM
YOU MUST LIVE ON THE INTERNET :D
 
@GMan I liked Martin's observation that among the five of us photographed at the SO meetup, we were equivalent to 1.5 Jon Skeets.
 
Xeo
@JohannesSchaublitb why troll-tags? :P
 
@JamesMcNellis Haha, I didn't hear that, that's funny.
 
because they are asked by trolls xD
 
@JohannesSchaublitb I don't understand, those tags mean the same thing.
 
12:37 AM
lol
 
Arrays are just pointers.
 
Xeo
@GMan Oh boy, here we go again
 
LOL.
Flagged as offensive, rofl.
 
._.
 
0
Q: C++0x confusion with using declarations

Johannes Schaub - litbWhat should happen for this case: struct A { void f(); }; struct B : virtual A { using A::f; }; struct C : virtual A { using A::f; }; struct D : B, C { void g() { f(); } }; The line of interest is f(). Clearly the lookup of f according to 10.2 of the FDIS succeeds and finds ...

 
12:45 AM
@JohannesSchaublitb Which of us do you think is capable of answering that question? ;-)
 
@JamesMcNellis you're all gurus of this field, I think.
 
:-) Well, this "guru" has to go catch a bus.
 
@JohannesSchaublitb Can you tell us the answer to this one? :( I haven't slept since you asked it.
 
Sleep is for the weak. Coffee should be more than sufficient. (I too would like to know the answer to that question, though.)
 
Xeo
@JamesMcNellis Am I a bad developer if I don't like coffee?
 
12:53 AM
@Xeo Basically.
 
Xeo
@GMan :(
 
@GMan one way to solve the second bullet is to do struct A : ::Template { }; A::Template<float> a;
 
Unless you have another source of significant amounts of cafeine
 
Note that simply doing ::Template::Template<float> a; doesn't work, because ::Template::Template will refer to the constructors of ::Template. Therefor, you need to access it using the derived class' name
 
12:56 AM
@JohannesSchaublitb Honestly, I don't understand that solution.
 
::Template will unambiguously refer to the typedef
 
Derive from the outer class to give it an accessible name
 
i.e to Template<int>. If you derive from Template<int>, the A class will inherit the injected class name of Template<int>. And the injected class name can be used as a template
 
@JohannesSchaublitb Oh, I see. Clever.
 
 
Fun stuff :-)
@Tenev does the answer you got not work?
 
Xeo
@JohannesSchaublitb Wow.
@Johannes, do you know the answer to the question you posted earlier?
 
Xeo
Oh well, lets give it a shot.. maybe my mind just did something useful
@Johannes, there you go with a possibly totally wrong answer :)
 
I'd think the answer would be that the class you derive from first is the one looked in first
 
1:07 AM
@Ronald has plenty of errors
@Ronald many things not declared
 
So B hides C...
@Tenev in the answer you got?
 
@Ronald yes
@Ronald trying to fix it now
@Ronald Very nice, now instead of segmentation fault the program gives FATAL : SegFault
 
hey all… first time caller here
 
Xeo
1:22 AM
@Potatoswatter Okay, first thing: I'm gonna name you "potatoes", since that's what I always read your name like... :)
 
Suddenly people are adding the "s"; it's part of the word "swatter"
Does the "X" in your name make a "ch", "ks", "h", or "z" sound?
 
Xeo
@Potatoswatter "ks", and ok, so it's just potato :)
@Potatoswatter Interestingly, I always read the last part as "water", leaving out the second 't'
 
I figured that… potato water doesn't sound appetizing
a potato swatter OTOH has amusing possibilities
 
im new here as well
@Xeo very interested how do you read my name
 
Xeo
@Tenev Tenef ?
 
1:29 AM
well thats infact how my real name sounds
:)
Cyrillic FTW.
http://stackoverflow.com/questions/5683553/c-get-file-name-and-line-number-of-segmentation-fault-linux-x64

someone help it please
 
Xeo
@Tenev One of my classmates is name Kirill, and seeing him program gives a whole new meaning to ""kirillic" (spoken cyrillic ;) )
 
@Xeo where is your classmate from :P
 
Xeo
@Tenev russia :)
but I really need to go sleep now, sorry o/
 
@Xeo and you?
 
Xeo
germany, and g'night for tonight
 
1:36 AM
#Xeo GN.
 
@Potatoswatter Beer can be made from potatoes.
@Potatoswatter: Welcome to the Lounge<C++>
 
That better be some strong beer!
Oh hi Tenev, i was just looking at your question
I patched up Tommie's answer, does it work with those changes?
Nice when a "not answerable" question is actually inspiring with an awesome answer…
 
1:59 AM
@JamesMcNellis Hey man! Battery died and I dropped out :)
 
@MehrdadAfshari Welcome to the party :-)
 
@JamesMcNellis A bunch of C++ experts hang around here. Not a safe place for me!
 
Well, at least it's type-safe
 
@MehrdadAfshari It's dangerous for anyone. ;-)
 
@JamesMcNellis So true...
 
2:09 AM
@MehrdadAfshari What are you studying?
 
@JamesMcNellis More importantly, so can Vodka.
 
@JamesMcNellis My research interests are mostly related to programming languages and software engineering; basically all kinds of tools and workflows that help programmers develop software easier, and with higher quality.
 
@MehrdadAfshari That sounds fun
@JerryCoffin But not Scotch. :(
 
@JamesMcNellis Yep. The good thing about "software engineering" is that you can do everything under its name, from project management stuff to PL and HCI ;)
 
@JamesMcNellis For Scotch you need a Squash
 
2:18 AM
@JamesMcNellis Quite true -- but I generally prefer Vodka to Scotch (but a good wine to either).
 
@Potatoswatter Scotch Squash sounds like Sasquatch. :-O
@JerryCoffin I've started to become more interested in wine; I know very little about it though and there is such great variety it is a bit intimidating.
 
@JamesMcNellis Squash scotch ~= hopscotch, or perhaps two teams playing hopscotch in opposing directions
@JamesMcNellis The more wine you have, the less intimidating it is :D
2
 
@Potatoswatter Very true.
 
Seriously though, getting acquainted with wine is free if not easy… around here Trader Joe's does open weekly tastings.
 
@Potatoswatter That is one problem with scotch: getting to know non-major labels is quite expensive. I may have to hit up some local wine tastings; supposedly Washington has a decent wine industry (or so people tell me).
 
2:30 AM
@JamesMcNellis No doubt.
/nick potswa
how do i rename myself?
 
@Potatoswatter You have to do it on stackoverflow.com
But be careful; nick changes last for 30 days.
 
oh i see, you and Jerry aren't nicknamed, it just line-wrapped your regular names
@JamesMcNellis yeah i learned that the hard way last April
 
@Potatoswatter As did I ("Unicorns are Yummy") and GMan ("Save the Unicorns")
 
@JamesMcNellis I didn't have the foresight to subtitle. I was Potatocorn, which looks like Potatocom, so then my messages didn't get delivered.
 
also I once changed my nick
to praise GMan
but @JamesMcNellis saved me
or was it someone else?
 
2:43 AM
@JohannesSchaublitb Ha ha, that's right; I forgot about that.
 
@JohannesSchaublitb saved?
Also, what is litb?
 
@JamesMcNellis Puts new meaning to "bloglitb"
 
@Potatoswatter Yes -- years ago in college, one of friends said something about "with a name like Coffin, what else could be make up to be insulting?" It was said, I'm sure, in the most friendly and respectful way possible though...
@JamesMcNellis Yes -- the Columbia river valley has quite a few vineyards running the gamut from decent to excellent.
 
2:54 AM
@JerryCoffin You're talkin' to a guy who's just been re-dubbed "potatos"… apparently Dan Quayle has some kind ethereal force
*kind of… not a kind force that
This question really put me off: stackoverflow.com/questions/5666899/… — is there a good online iostreams reference/source to point people at?
 
3:09 AM
@Potatoswatter None of which I'm aware. Langer and Kreft is good, but not (at least AFAIK) available online (or freely).
 
@JerryCoffin Yeah, that's the only actual reference I've noticed… and it's old, too
which isn't per se bad, but practices change
 
@Potatoswatter Quite true. At one point Andrei talked about (and I believe started work on) an iostreams implementation that was going to use/espouse all the latest stuff (as you'd expect from him). AFAIK, he's never finished it though.
 
@JerryCoffin I was disappointed more wasn't cleaned up for C++0x. I dove into codecvt late last year, but it was already too late for suggestions to matter, and got "distracted" by a new job
@JerryCoffin I oughta look at Boost streams, whatever they have… not today though :P
 
@Potatoswatter It is disappointing, but (at least to me) not particularly surprising. Even though only a faction of what's available is widely used, what is used is used heavily, so almost any changes would be non-trivial.
 
@JerryCoffin I found a surprising amount of outright ambiguity
can't remember the particulars right now, but it seemed very important when I was trying to make a codecvt do cryptography
 
3:20 AM
folks
 
Xeo
Johannes
 
my book "Garbage Collection" by Jones and Lins just arrived. it's exciting
 
That stuff can get ugly… optimizing against the cache + memory hierarchy.
On the flip side, Quincy Jones and Ivan Lins wrote a song together: youtube.com/watch?v=GrcW0iLefAk
 
@Potatoswatter I'm not sure I've ever been able to confirm outright ambiguity, but there's no question that (especially with codecvt) it's really ugly. Part of that is because it's oriented toward (or at least to allow) things like Shift-JIS, and has all sorts of things that border on nonsense for UCS or UTF types of encoding.
There's also a fair amount I'm pretty sure was done on the "because it's probably a good idea" sort of thinking, and nobody's ever implemented a lot of what was intended to be supported, so nobody's really sure whether what's there is either necessary or sufficient.
 
@JerryCoffin That's just what I was trying to figure out… here's about where I got to: groups.google.com/group/comp.std.c++/browse_thread/thread/… *fixed the link
ah, or cut to the code: pastie.org/1188625
 
3:38 AM
@Potatoswatter That works -- and yes, it's definitely ugly. I should add that I spent some time years ago looking carefully at the requirements on streampos/streamoff, and such. When you get down to it, it's not ambiguous, but I'm pretty sure it really is circular, so when you get down to it, there's no real definition of actual requirements.
 
@JerryCoffin The ambiguity was in the little details, like when does a termination sequence need to be written
It's kind of like Schwarz wanted certain things to be possible, and then realized he was out on a limb, and just stopped specifying
 
@Potatoswatter As just noted, I'm pretty sure there are things that are just left undefined, so it's essentially impossible to say what's really required. That's not what I'd normally call ambiguity though.
 
@JerryCoffin Ah, here's the one that vexed me… it turned out the intent was clear, but still… gcc.gnu.org/ml/libstdc++/2010-09/msg00129.html
meh… it's a lot to wade through, but the right thing to do would be get back and finish what i started
 
4:16 AM
@Potatoswatter Yeah, that sort of thing doesn't bother me nearly as much as some others. There it seems pretty clear what's intended, and what you should do (though, in all honesty, I'd consider calling imbue in the middle of a stream pretty close to suicidal anyway...)
The ones that bother me more are where it's pretty clear that something was intended, but when you get down to it, it seems pretty clear that nobody quite thought things all the way through, and it's impossible to figure out what you should really do.
 
@JerryCoffin To me, it seems much safer than opening another stream to the same file… those are the only alternatives for a file with multiple encodings inside
@JerryCoffin Yeah, the mbstate_t deal falls into that category.
 
@Potatoswatter I suppose if you really have no choice but to produce a file with multiple encodings, that's probably true. I can even see why that was sort of hard to avoid at one time (e.g., having to store both Russian and Japanese together when all you had was ISO 8859, Shift-JIS, etc.) Nowadays, the only reasonable question for those situations is whether you're going to encode in UTF-16, UTF-8 or possibly UCS-4.
 
@JerryCoffin It happens all the time with XML <?CDATA>
 
@Potatoswatter See -- you always knew XML was evil, and now you have proof! :-)
 
@JerryCoffin I always knew XML was evil, since I was like 13 when I was first exposed to it. At this point I just harness it to visit terror upon my enemies.
But anyway, the really interesting applications of codecvt to do things besides text encoding really only open up when you do allow that kind of mode change
 
4:29 AM
@Potatoswatter XML is one of those nice things that you can go along with the PHB requesting it, and just smile and know he's going to be gone soon. I managed to convince on nutcase to use XML containing what was basically an XML-encoded version of ASN.1. He got fired rather abruptly not long after that...
@Potatoswatter Yeah -- it would be cool to handle things like encryption and compression at the codecvt level, but I'm not sure how practical it really is given the current design.
 
@JerryCoffin I have a lot to learn… you use your weapon well sir.
@JerryCoffin Well, either it supports N-to-M or it doesn't. I say it does, Jerry says it might but he lost track.
 
@Potatoswatter Presumably you mean Jerry Schwarz, not me?
 
@JerryCoffin yes
The mbstate_t fiasco is a killer, though.
 
@Potatoswatter The funny part was, at least at first I wasn't serious at all. In fact, I was kind of being sarcastic about how poorly suited XML was to the task at hand, and pointed to something I thought was even more ridiculous -- but he not only took it seriously, but thought it was really great.
 
@JerryCoffin They like anything they can recognize.
Imagine the cognitive dissonance those guys face every day… any little respite is welcome.
 
4:39 AM
@Potatoswatter In this case, he liked standards - the bigger the better. When he found out that ASN.1 had something like 6 volumes of standards, I'm pretty sure he thought he'd died and gone to heaven.
 
@JerryCoffin Heh… well I have nothing against standards. Hmm, never heard of that one. Is that really any more meaningful than Backus-Naur Form?
 
@Potatoswatter yeah -- fundamentally, the problem is that you need a design that's designed specifically to support multiple layers, each of which can be added or removed independently of the others. As-is, codecvt is the only layer, even though you could reasonably have two or three independent transformations happen there.
@Potatoswatter Looking at things, I understated it: no fewer than 10 standards: itu.int/ITU-T/studygroups/com17/languages
All of them from the ITU too -- you know you can't argue with that. It has "International" right in the name!
 
@JerryCoffin Yes, there can only be one codecvt per streambuf. But that's because the streambuf owns the buffer that the codecvt uses. On the other hand, a streambuf where the underlying sequence is a streambuf is perfectly feasible, and should probably be standardized. That gets you layering.
@JerryCoffin LOL. Too easy to pronounce, I insist on the CCITT.
 
@Potatoswatter Yes, you can/could do things that way. The current structure doesn't prevent it, but does little to support it either.
@Potatoswatter I don't remember for sure, but for him I probably used CCITT/ITU-- I'm pretty sure he was also the founder of the department of redundancy department.
 
@JerryCoffin Were you actually in telecom, or just "borrowing" standards?
That one is general, but I thought u mentioned another… maybe it was the same
 
4:59 AM
@Potatoswatter Oh lord no -- this had nothing to do with telecom at all. Yes, those were the only standards in question here. It seemed like enough to me at the time.
 
5:41 AM
alright, gnite all
 
 
2 hours later…
sbi
7:56 AM
7 hours ago, by Xeo
@JamesMcNellis Am I a bad developer if I don't like coffee?
@Xeo No. I don't drink much coffee either.
@Potatoswatter Very welcome to the chat!
 
Xeo
Mornin' @sbi!
 
sbi
8:16 AM
@Xeo Hey.
 
Als
8:27 AM
@sbi, @Xeo: Hello!
 
sbi
@Xeo: I just suggested a date for the 2nd Berlin meetup. Are you going to come this time?
 
Xeo
@sbi Can you give me the link again?
 
Xeo
friday evening looks fine
 
sbi
@Xeo That's what I figured.
 
9:11 AM
ah, weekends are awesome. More of those please!
 
9:40 AM
@jalf Sorry, I don't have spare one.
 
10:16 AM
morning all
 
hello all
 
hey
 
@jalf hello how is things?
 
pretty well. Just relaxing with a cup of coffee, some orange juice and my laptop :)
 
heheh nice :)
 
10:26 AM
was planning to work on my library, but my ability to concentrate seems to have evaporated
so now I'm just rewatching an episode of Battlestar Galactica instead :)
 
oh I so know that feeling :P
 
10:45 AM
@DeadMG: on the typename thingo here: `a<T>::x()` this can be interpreted, and processed as at least three things:
template <typename T> struct a { static void x(); } // static function call
template <typename T> struct a { typedef T x; } // value initialization (*)
template <typename T> struct a { static callable x; } // call to x.callable::operator()()
Value initialization is NOT calling a constructor, consider the type:
struct test {
   int a,b;
   std::string s;
};
the default constructor for test would be test::test() : s() {}, but value initialization is equivalent to test::test() : a(0), b(0), s() {}
 
11:08 AM
good morning ladies
A Long Island Iced Tea is a highball made with, among other ingredients, vodka, gin, tequila, and rum. A popular version mixes equal parts vodka, gin, tequila, rum and triple sec with 1½ parts sour mix and a splash of cola. Most variants use equal parts of the main liquors but include a smaller amount of triple sec (or other orange-flavored liqueur). Close variants often replace the sour mix with sweet and sour mix or with lemon juice, the cola with actual iced tea, or add white crème de menthe; however, most variants do not include any tea, despite the name of the drink. Some restaurants...
:)
 
 
1 hour later…
12:17 PM
@DavidRodríguezdribeas value initialization calls the default constructor if it is nontrivial
that's needed, because among other things, the vptr needs to be set up
Another reason is that in addition you need to catch exceptions thrown from non-trivial ctors of bases and members, and destruct the already constructed members and bases again. So in fact, while in C++03, value initialization of a class did value initialization of all data members and bases, in C++0x that's not the case anymore. In C++0x, the object as a whole is zero initialized. And afterwards the default ctor is called if nontrivial.
note that zero initializing an arbitrary class object won't call any constructors. it will just recursively zero out members (their storage). so it's guaranteed that in that phase, no exception is thrown
 
computer address are made up by samples of incoming signals.....
 
@Miss All of reality is made up of samples of incoming signals!
@JohannesSchaublitb: Are you saying that in C++0x, value initialization effectively begins as if the allocation function were calloc?
 
12:32 PM
hmm, the std lib doesn't have a clever way to sort and remove duplicates in one go, right? If you have a list with many duplicates, doing a complete sort first and then removing duplicates would be needlessly expensive
 
@Potatoswatter padding is not initialized
@Potatoswatter ohh it is!
 
@jalf: try an insert_iterator into a set
There's gonna be some minimum duplication rate to make it advantageous
 
oh, I forgot to say, dynamic allocations are pretty much a no-go. Assume I'm sorting a vector or array :)
 
@jalf: You could use some kind of pigeonhole sort
but sorting first and then removing is the fastest algorithm I know of to just remove duplicates, let alone sort and remove
 
@jalf: it's not easy to make that work with a recursive partitioning sort because rejecting the elements midstream changes the size of the partitions… you end up shifting things around at some point, and the most efficient way to do that is unique.
@JohannesSchaublitb On the bright side, you know your garbage collector is fast enough when an allocation busy-loop is dominated by nonsense like zeroing the padding
 
12:44 PM
@Potatoswatter however if you do A a = A();, it is not guaranteed that a is all-zero. but if you do A a{}; I think it is
 
@DeadMG Sorting first is O(n lgn) in the total sequence size though. Suppose you have an array of a few hundred elements, but only 2-3 unique ones, that'd be a lot of moving data around unnecessarily.
 
because when you do A a = A();, the temporary is all-zero, and then you member-wise copy, ignoring the padding
 
@jalf: How else are you going to remove dupes?
 
only in A a{};, the a is directly all-zero initialized
 
I guess the sensible solution would just be to keep it sorted while building the list
 
12:45 PM
@JohannesSchaublitb Good to know… but I'd rather have good old uninitialized space… and don't check the result of placement new against NULL!
 
@DeadMG like std::remove, basically. I just want a smaller, unique and sorted subsequence at the beginning of my vector, and then I don't care what garbage occupies the remaining part of it
 
anyway, now that I try to explain it to others, it seems pretty obvious that I should just keep it sorted during insertion as well, and filter out the duplicates there and then, so they never enter the sequence at all
 
@jalf Wait, insertion sort (or rejecting duplicates from an unsorted list) is O(N^2), and unique is O(N) which doesn't affect the asymptotic behavior sort at all
 
1:43 PM
@JohannesSchaublitb I though calloc intialized to binary 0 while value initialization initialized to value 0. The difference is meaningful only if value 0 isn't the same as a binary 0 obviously -- and I can't think a common architecture where it is the case.
 
@Potatoswatter true, but this is about actual running time, not asymptotic big-O complexity. :)
consider as I said before, that I'm anticipating very few unique elements, meaning that if I filter out duplicates during insertion, the list will stay very small, and most inserts will be nothing more than a search in these few sorted elements, followed by discarding the element because it already exists
 
@jalf ah. Insertion sort it is, then.
What's the status of Comeau? Does EDG have a C++0x project, or will they fade from glory?
 
2:07 PM
@AProgrammer ohh right
silly me.
 
@Potatoswatter EDG has a C++0X project. I don't know how well Comeau is following them.
 
pointer to data members are commonly all-bits-one for zero initialization :)
 
@JohannesSchaublitb ... and thus the nuance if not mostly academic as I though.
 
@JohannesSchaublitb Wait, that was the jist of my question. The defect resolution said to zero the object representation, followed by zero-initialization of the members.
 
2:10 PM
thanks for reminding me
@Potatoswatter ohh right!
yeah, the padding bits are zero bits. so I think it's the same as calloc + then initializing the members.
lol
 
2:27 PM
@JerryCoffin CP/M AFAIR. But it's possible I'm remembering something wrong.
 
2:40 PM
@PiotrLegnica It could be -- it didn't have paths, so it would only be the syntax used for switches, but I don't remember that with any certainty.
@Potatoswatter Comeau's current C++0x feature list is at: comeaucomputing.com/43101features.html#newstuff
 
@JerryCoffin Of course… but the website hasn't been updated since 2008, and the best other source I know is Wikipedia, which says the old website is accurate.
 
It looks reasonable, but almost anything is likely to be a "fade from glory" -- while others may remain a little behind, there won't be something big and obvious to point at that's unique to them.
 
@JohannesSchaublitb If I'm understanding correctly, both A a = A() and A a{} result in value initialization and thus all members have an initial value well determined. A a results in default initialization and some members may have an undetermined initial value.
@Potatoswatter I've not seen Greg Comeau active on C++ related usenet groups for a couple of years.
 
Ah, come to think of it, all those bug reports I sent were worth something after all. I received a response from them last September, which proves they are still working on it.
 
@AProgrammer A quick search shows some recent activity: groups.google.com/group/comp.os.plan9/browse_frm/thread/… It's not on a C++ newsgroup, but still seems to be related to new compiler development. His signature still shows the 4.10.1 beta that's visible on the web site.
It does look like a few relatively recent posts, one in 2009, and then back to 2008 when there was quite a bit of activity.
 
3:00 PM
@AProgrammer To be more precise, value initialization provides the garanteed of no initialized members only when there isn't a user provided constructor.
@JerryCoffin You are more thorough than me. I was relying on memory. A couple of years isn't bad qualification for 2008.
Good to know that he is still active. One day I'll ask him a more recent version than the one I've.
 
@AProgrammer Your mention of it got me curious, but I was pretty impressed with how accurate your recollection was. About the best I could have come up with was, "yeah, it's been a while since I noticed anything from him..."
@AProgrammer I should probably do that too. My copy is version 4.3.3, January 13, 2004.
Even though I believe purchase was supposed to include free updates forever, I may pay him again anyway -- $50 for that good of a compiler is a pleasure to pay!
 
@JerryCoffin We have the same. It stopped working here when I went to 64 bit linux and I never took the time to ensure it wasn't my fault. Then I lost the habit to compile my stuff with it.
@JerryCoffin 50$ to help keeping easy public access to the EDG front-end may indeed worth it.
 
3:44 PM
@AProgrammer yes -- I think so anyway.
 
@AProgrammer i have no idea whether it makes any difference whether or not padding is all-zero-bits or not
so i'm not sure what I previously said makes any sense. hmm
 
@JohannesSchaublitb The rationale in the DR is using memcmp on class objects.
Or do you mean, what is the meaning of zero within padding? If reinterpreted as a number, that number would be zero? What kind of number for that particular platform?
Very zen…
 
if a zero-padded object falls in the forest and there's no one around to hear it...
 
@Potatoswatter but I'm not sure whether the padding is "stable". writing into one member may overwrite part of padding
 
@Johannes: then the padding would be part of the member and not directly owned by the class object, right?
 
3:51 PM
so I'm not sure whether setting everything to zero bits in the padding area solves the memcmp problem. at least, theoretically i mean. I understand that pratically, an impl will have most likely only one representation for every particular value, so that it overwrites padding always the same way
padding seems to be allowed to contain any junk bits an impl could like it to contain
 
how would writing to a member overwrite padding?
 
i've tested with gcc
 
I think if the implementation generates duplicate representations or some kind of junk data (think ±0), the user is probably trying to be sensitive to them if they're using memcmp
 
@JohannesSchaublitb I'd not be surprised that a compiler overwrite the padding with random value (say if you have only word sized store and you are storing a byte the compiler won't take the pain to read the padding so than the next write don't change its value).
@Potatoswatter It solves the memcmp problem for an initial value, but not after some use of the union...
 
@JohannesSchaublitb in terms of the standard, I mean. Does the standard explicitly allow this to happen, or does the compiler just do it under the as-if rule because no one cares what happens to the padding?
 
3:54 PM
at least gcc is not conforming to the c++0x spec
 
@AProgrammer That would make special cases for volatile byte objects
 
or so it seems
struct A { short x; int y; };
void f(A const& a) {
  unsigned char const *c = &reinterpret_cast<unsigned char const&>(a);
  for(int i = 0; i < sizeof(A); i++)
    std::cout << std::hex << +*c++ << " ";
}
int main() {
  f(A{-2, -2});
}
this one outputs on my 32 bit system fe ff 4 8 fe ff ff ff
but i'm not sure whether it's really nonconforming
 
Well there is the step of matching the DR to text actually in the standard ;v)
 
@jalf i'm not aware of the spec saying anything about the value of padding bits when writing to a member
but perhaps it says something... i'm not sure
i would be surprised if it couldn't simply use memset(0xfe) to initialize f(A{-2, 0xfefefefe});
(if we have the first member be a char)
 

« first day (182 days earlier)      last day (4768 days later) »