« first day (76 days earlier)      last day (4871 days later) » 

7:40 AM
the sheer silence....
 
 
2 hours later…
9:31 AM
@JamesMcNellis Really? I don't think that the hardest part of C++ is the undecidable grammar (as bad as it is); you've still got all of the exciting semantics to implement. Name lookup, overload resolution, implicit template instantiation, exception handling mechancisms, etc., etc. .
2
 
10:28 AM
when you have a struct that overloads the operator(), it has a non default ctor, how do you call the operator on this object?
 
@Tony The same way you would with any other object obj(params). How you construct it doesn't matter.
 
10:49 AM
@Tony And if you want to create the object on the fly:
my_class(constructor_argument_1, con_arg_2, ca3, ca4)(apply_argument_1, app_arg_2, aa3, aa4);
 
so why is my compiler not liking this then: QueryMedicalObsDefTable tst(request)();
?
 
That looks like a declaration. You can't do anything with the object you're declaring in a declaration except initialize it.
Do you want QueryMedicalObsDefTable tst(request); tst(); ?
 
yes I think thats what I want
 
Do you need to use `tst` multiple times or only once?
If it's only once, you don't need to name it.
QueryMedicalObsDefTable(request)(); will do it then.
 
11:05 AM
@FredOverflow I need it later on
so unfortunately I cannot do it that way in this particular case
 
@Tony Well, brevity is not always good... :)
 
hehe
but for less typing it is good
lol
 
 
1 hour later…
12:29 PM
What I love about SO is that I always get to learn something even when answering the most useless question of all
The "Printing 1 to 1000 without loop" finally got me to look into Boost.Preprocessor
Well, I thought boost::mpl was black magic, but this is just insane
 
 
3 hours later…
3:19 PM
@CharlesBailey That's not what I meant; I meant that once you already have a working C++ compiler, building a new parser and integrating it should be relatively easy compared to writing a whole new compiler for a new language.
 
@icecrime i've reverted to good old binary system:
1
A: Printing 1 to 1000 without loop or conditionals

Johannes Schaub - litbHere is a real stupid solution: printf("1 10 11 100 101 110 111 1000\n"); I suppose for the kicks you could use C++ int main() { std::stringstream iss; iss << std::bitset<32>(0x12345678); std::copy(std::istream_iterator< std::bitset<4> >(iss), std::i...

@James all the advantages wrt the faster parse time are lost then :(
tho i wonder whether parsing taks all that much time anyway?
 
@JohannesSchaublitb Well, if the goal is "improve C++ by simplifying its grammar and not changing anything else," then yes.
 
I don't know how much time is spent parsing. To be honest, I've not been particularly concerned about compilation performance of C++ in a while. New computers, good modular architecture, and incremental linking make it just fast enough.
 
3:33 PM
Oh.
 
Guys, emergency question, I'm using some hosting and did an infinite for loop
what happens?
(in php)
will they cancel my account? will I destroy their servers?
 
3:50 PM
likely depends on the hosting, but i imagine if you are consuming more than your quota of CPU resources they restart your server, maybe send you a warning
if your server is impacting other clients, they might shut you down for good
 
is there nothing on their side that will stop the script? its just a for loop! I can't be the only person to ever make this mistake...surely?
 
you'd really need to ask them. but they may kill your server process. that will terminate the loop
i just wrote this code for production. i amuse myself
static const unsigned max_pmap_bits = sizeof(pmap)*8; // assuming 8 bits per byte ;) elbereth help us if this is not so
 
sbi
@John There's a macro in the C std lib, CHAR_BITS IIRC.
 
oh nifty
 
sbi
@JamesMcNellis I've been in a project where incremental linking brought the link time down to little less than 10mins - if you had only changed one cpp file, that is. You feel cursed having to work that way. Changing some of the template stuff in the headers I was responsible for had you sit back and relax for an hour. Distributed compilation brought everything down to 10-15mins. Still, that only makes three see-think-edit-build-test cycles an hour.
 
3:59 PM
but truly, if there aren't 8 bits per byte, the value of max_pmap_bits will be the least of my worries :)
 
@sbi Yuck.
 
sbi
Yeah, I think never again will I underestimate the compile/link times of C++. They are definitely hilarious.
@JohnDibling That you might have bigger problems is no reason not to tackel the smaller ones once you cross their path anyway.
 
@sbi: did not find CHAR_BITS in either the C++ or the C specs
 
i think it's CHAR_BIT
 
@litb, @sbi: yes, indeed. CHAR_BIT is in <limits>
 
4:02 PM
Not to be confused with CHAR_COAL
 
sbi
@JohnDibling According to this, it's in <climits>.
 
here we go, in C std 5.2.4.2.1/1:
 
please discuss!
0
Q: Testicles as food?

Johannes Schaub - litbWhen I read that you can buy and eat testicles I wondered whether I should try it once, since I'm basically open to anything that tastes well. I wonder how I should prepare them. If I buy testicles are they empty or do they still contain the, err, fluid? How to properly make them up so they are...

 
— number of bits for smallest object that is not a bit-field (byte)
CHAR_BIT 8
 
4:05 PM
BTW did alf p steinbach leave stackoverflowß
 
@litb: if you're ever in Colorado, be sure to order "Rock Mountain Oysters" in a restaurant sometime
 
"Rocky Mountain Oysters" that is
 
4:06 PM
@JohannesSchaublitb Maybe he is on Christmas vacation.
 
There was a scene in "Log Way Round" in which Charley Boorman and Ewan McGregor ate testicles
@sbi: you can never be too careful in production code
static const unsigned max_pmap_bits = (sizeof(pmap)/sizeof(char))*CHAR_BIT;
 
Well sizeof(char) is a bit too cautious. If it isn't 1 then you really do have much bigger problems.
 
well that is true
here's a doomsday prediction. if sizeof(char) were to be changed to something other than 1, I bet the world's economies would collapse overnight
so much code in financial systems rely on char being 1 byte, even if the programmers didnt realize it
 
That would be a funny joke for a working draft--change the specification of sizeof so that sizeof(char) is guaranteed to be 1000000000.
 
4:31 PM
sizeof(char) is always 1
 
Right.
 
 
1 hour later…
5:55 PM
Thoughts? Why are nested classes inherently bad? stackoverflow.com/questions/4571355/nested-classes-c
1
Q: nested classes C++

user552127Can someone please point me towards some nice resources for understanding and using nested classes? I have some material like Programming Principles and things like this: http://publib.boulder.ibm.com/infocenter/lnxpcomp/v8v101/index.jsp?topic=%2Fcom.ibm.xlcpp8l.doc%2Flanguage%2Fref%2Fcplr061.htm...

 
 
1 hour later…
Kos
7:22 PM
@JohnDibling Posted a handful of notes when there are not bad (and possibly even marginally useful).
 
7:58 PM
I still dont get why people hate nested classes. Sounds like blind zealotry to me.
 
I waffle between using detail namespaces and using nested classes.
I'm not sure which I think are cleaner. I guess it depends.
 

« first day (76 days earlier)      last day (4871 days later) »