« first day (92 days earlier)      last day (4858 days later) » 

8:00 PM
fuck the general case, it does me no good on any single specific project, which have real requirements
 
that's true
but there are some people who have requirements like no exceptions
should I cater to them too?
 
anyway, I'm going out for beer, later
 
8:24 PM
@jweyrich I still don’t believe that. How can the compiler know that ranges don’t overlap, and more importantly, why does the compiler know that but not the type system (otherwise it would be possible to apply this optimization using template specialization or SFINAE)
 
@KonradRudolph it doesn't know for all cases. But for this example it's a trivial job. SFINAE isn't possible because the preprocessor doesn't allow variables.
 
Okay
But let me offer a hypothesis
this optimization doesn’t happen in std::copy
 
@KonradRudolph the compiler always knows much more than the type system. Take this as an example of possible optimisation - char array[1024]; for (unsigned int i=0; i<1024; ++i) array[i] = 10 - The compiler can vectorize this and generate only 64 writes using SSE instead of 256 writes on 32 bits or 128 writes in 64 bit.
 
in fact, I claim that the compiler is oblivious of std::copy
it just writes the code using memcpy which is subsequently unrolled by the optimizer
then the optimizer notices that the blocks aren’t overlapping and re-rolls the loop into memmove
or summin like that
@jweyrich Yes, of course the compiler knows more than the type system here.
What I meant (and failed to articulate) is that the optimizer, which has no information whatsoever of the standard library, can apply some well-documented optimizations here after the intermediate code has been generated
 
@KonradRudolph just to clarify my previous statements, when I said compiler, I meant to include the optimiser, as it's part of the compiler.
 
8:36 PM
That’s understood
 
@KonradRudolph that's absolutely true. But the optimiser generally has knowledge about the standard and can optimise even further. I should find some references to back me up here.
 
Ok, now we’re on the same page :)
 
The whole debate was about FredNurk's affirmation: "that's done in the library rather than the compiler optimizer". Which is wrong on the given std::copy scenario.
 
Yes, I see that now
at the moment I’m not even sure any more how that wasn’t clear from the beginning … perhaps it’s just too late for me
(it’s evening here and I’ve been working all day on multithreaded schedulers)
 
8:51 PM
@KonradRudolph sounds fun. I'm about 20-30 days without touching any real code. Currently looking for a new job, but I only see Java and .NET around here. Considering to move.
 
In C++, if constructor is explicit, it cannot be used for type conversion. Could some one please let me know why this(pastebin.com/Jq0G4k7M ) is working ? Visual Studio 2010 just leaves me with a warning - warning C4244: 'argument' : conversion from 'double' to 'int', possible loss of data
 
@jweyrich That’s in wait for me starting next month, but I could get lucky …
@Mahesh It can be used for conversion – just not implicit ones.
In your code, you’re explicitly calling a constructor. on the object obj of type foo. Everything’s fine
However, this wouldn’t work:
foo obj = 10.25;
Without explicit, this would work
 
I understand that foo obj(10.25); calls the constructor and foo obj=10.25; calls copy constructor.
@Konrad Rudolph: Why is converting it in constructor case then?
 
Well, how else would you call the explicit constructor?
 
@Mahesh obj=10.25 doesn't call the copy-constructor because 10.25 isn't a foo object.
 
8:59 PM
@jweyrich: Could you explain how foo obj = 10.25; is constructed. I mean the stages of it.
 
@jweyrich You’re wrong, it does call the copycon
 
@Mahesh it shouldn't work with that explicit constructor. If you didn't have the explicit, or if the argument type was float, it would invoke the explicit constructor passing the rvalue (10.25) by argument.
 
(It just elides it afterwards)
 
@KonradRudolph hmmm.
 
Doesn’t surprise me
foo x = 10 is identical to foo x = foo(10)
in both cases, the copy constructor will be elided but it must still be callable
 
9:07 PM
@KonradRudolph : I am sorry. I still don't understand the rationale of why in foo obj(10); is working and foo obj = 10; isn't working when constructor is declared as explicit
 
@Mahesh ignore what I said, I'm plainly wrong.
 
the whole point is that foo obj(10) is as if you directly call the constructor of foo as a function
 
@JohannesSchaublitb - continue ...
 
it's all what i wanted to say xD i don't know what I should say about foo obj = 10 xD
 
Ok ..
 
9:12 PM
gotta rest. Be back later, if I survive to the storm.
 
Shall try the luck posting question in forum
 
it's an initialization of a foo object with 10. you are pretending that 10 is equivalent in value to a foo object.
 
k
 
and the explicit will make sure you don't lie
c++ has this completely horrible semantics that string s = false; compiles
 
Surprised?
 
9:13 PM
ideally, it would fail. a string(bool); constructor would thus be declared explicit as "explicit string(bool);"
lol
 
never thought about that.
is that fixed in 0x?
 
i think it's not
 
i don't even think std::string s(0) makes much sense.
and if you disallow that then it fixes the bool at the same time.
 
Will std::string s(0); work too ?
 
it causes UB
 
9:17 PM
yes. because you have a constructor that takes a char*.
but i don't think you can fix that at compile time.
and you can fix bool at compile time.
 
@Mahesh so a good way to think of it is T t(x) as "ctor call" and T t = x as "value conversion"
 
to make it perfect, should the constructor be declared this way - explicit string( const char* ); . Isn't correct ?
 
@JohannesSchaublitb but T then must be of a class type.
 
0 isn't a vector (in the abstract sense) at all, so vector<T> v = 0; should fail, as it does. But you can construct a vector from 0, and get a zero-sized vector. vector<T> v(0); is allowed
 
@Mahesh that would disallow std::string s = "Hello";
 
9:21 PM
@wilhelmtell yeah i meant to talk about the class case. i should have said so
 
@wilhelmtell : Didn't think about it. ;)
@wilhelmtell - Isn't "Hello" a type of const char* ?
 
@Mahesh it's a char[]. Proof std::cout << sizeof("1234567890") << std::endl;
 
sbi
Have you seen this blog?
"In order to encourage more flagging, we have increased the number of general moderator flags available to 10 per day, plus one per every 1k of reputation, up to a maximum of 100."
"If a particular user keeps moderator flagging for reasons that we consider invalid, their flag weight decreases. And for those users who continually flag reliably, their flag weight increases."
"...we’ve made a ton of improvements to the moderator and 10k tools pages on the back end to assist in handling this increased volume of flags"
(Sorry for jumping in with a completely different topic...)
 
@sbi Ja
what of it?
 
@jweyrich - Thanks.
 
9:28 PM
what does it mean that "flag weight increases" ?
 
sbi
@KonradRudolph Um, for starters: What are those "tons of improvements on the 10k tools"?
 
hm disappointing that "spam" only captures advertisements. what about "edsartedsacyrtoienfidsanfioew ahahaha this is NOT an advertisement spamm!" posts?
 
sbi
@JohannesSchaublitb You might want to read the blog posting. In short, the system keeps a weight for your flagging quality. Supposedly your flagging is of more concern if you have a lot of weight.
@JohannesSchaublitb "not welcome?"
"low quality"?
 
ah right i think i will consider such "abusive" as they abuse the SO system
finally I understand what the heck this "abusive" flag is about!
lol
hm wait, according to this english dict, "abusive" means something else -.-
 
Exactly what I was about to say. I hate people abusing the word abuse.
 
9:34 PM
Huh, there it is again, this weird flagging symbol
Does anybody else have that?!
(the blue thingy)
 
Yes.
In chat.
 
sbi
@KonradRudolph You get this whenever someone flagged something as spam or "abusive" or whatever. Click on it and if you feel the same, say "yes".
 
@sbi Ah. I was confused since on Stack Overflow only moderators can see flagged posts
 
I wish there'd be a way to ask the system to stop abusing its moderators.
 
hey guys
3
A: Performance of qsort vs std::sort?

DeadMGstd::clock() is not a viable timing clock. You should use a platform-specific higher resolution timer, like the Windows High Performance Timer. More than that, the way that you call clock() is that first, text is output to the console, which is included in the time. This definitely invalidates th...

I'm not very happy with this question because the OP's code was terrible, I fixed it, and I still got his results :(
 
sbi
9:37 PM
Since I'm on a mission to rid this forum of useful discussions: There's two messages containing German starred on the right side. Supposing no non-German speaker would have starred these, the stars say more about the German domination in this room than the messages themselves. :)
 
hey
apparently, I can pin things in that list
 
@sbi Well, for one thing 10k users can now see flagged comments even though they’re not moderators
 
didn't know that
 
@KonradRudolph hmm i thought that >10k users could see flagged posts in the moderation tools page
 
sbi
@DeadMG So it seems you're a room owner.
 
9:38 PM
Awwwww, look! It's a puppy!
 
@sbi Germans dominating? It's not the quantity that matters, it's the quality. :p
 
sbi
@JamesMcNellis <yawn/>
 
@JohannesSchaublitb Since always?
 
lol
apparently, I am
 
I don’t remember that but I may be mistaken – I didn’t visit the 10k tools in ages
 
9:39 PM
yes, it's a puppy
my puppy, specifically
 
@KonradRudolph i only found out by accident about it. so i'm not sure when they introduced it
 
I don't have Internet at home at the moment, so I'm a bit behind the times, sorry. :-)
 
sbi
@wilhelmtell Yes, but aren't the stars all about quality?
@wilhelmtell Anyway, I liked that posting, so I starred it and pushed one of those mishmash ones off the list.
 
@sbi Ah, but who said it doesn't mean the non-Germans here are so awesome that they speak German too, on top of the 3 other languages they speak?
 
I do
as I don't speak German
 
9:41 PM
lol
 
or indeed any other natural language apart from English
 
Neither do I. But the point stands.
 
sbi
@DeadMG You do what?
 
artificial languages all the way, baby
 
Auch wenn ich nicht Deutsch sprechen, habe ich noch wissen, wie man Google Translate benutzen ;-)
 
9:41 PM
i can'T speak english. i only write and read it
 
@DeadMG Uh … don’t you guys have, like, a foreign language at school?
 
nope
 
sbi
@wilhelmtell If SO is dominated by one culture, it's the U.S. one. If I see your message in that light, it seems shady at best.
 
@JamesMcNellis careful with Google Translate. Careful. :p
3
 
my year was the first that wasn't forced to learn one
god bless it
they had no feasible means of ensuring that we actually left school with any useful skills in said language, and almost all failed
 
9:42 PM
@ALL I am posting my question on forum. Hope no one misunderstands me. Just trying if anyone could explain in a better way
 
so they cut it
 
shady?
 
@DeadMG “the first … not forced” excuse me, but that sounds very stupid
 
you're right
 
on the part of the education system, that is
 
9:42 PM
i guess this will turn out to be a problem once I visit some global developermeeting
 
it's unbelievable that our government used to think that they could force people to learn other languages
 
English is the only language I speak; the only other language I learned in school was Latin...
 
the fact is that it was remarkably ineffective at actually producing pupils who could speak more than one language
and English is increasingly dominant in almost all areas
 
sbi
@JamesMcNellis Have you tried to translate this back into English? A Canadian art student made an art project of having the online bablefish translate some piece of text back and forth between languages. Pretty weird result.
 
also
damn
 
9:44 PM
in the end, all human will talk english i suspect. evolution will do so
 
I speak English, Hebrew and French. German was supposed to be on the list, but my roommate didn't cooperate as much as I'd hope. :p
 
was about to say that the flood filter seems relaxed, but then it bit me
 
@sbi No. I just figure that whatever I put into Google Translate, it turns into a proposition for sexual favors or something. I'd never know the difference.
 
rofl
 
sbi
@Mahesh Uh oh, bad timing on your part. I'm on a highly successful rampage to stop useful discussions here, so you need some perseverance to get your message through. :)
 
9:45 PM
lol
 
i discovered whatever weird shit you put into the google translater using some languages, it always outputs some funny sentence
 
it's not that I don't believe that learning another language would be useful
well
that pretty much is it
 
I think you need solid AI for a solid NLP.
 
I had some other sentiment, and then realized that they were basically the same
just like I don't program platform-independently, I stay in my Windows comfort zone
 
"บทกปไ" turns out to be "A true lesson last year." lol
 
9:52 PM
@DeadMG On the danger that you were being ironic, that’s an incredibly narrow-minded and short-sighted position for a variety of reasons, which nobody can formulate better than Eddie Izzard
“I’m sorry Europeans but we’re gonna have to be bilingual …”
@JohannesSchaublitb You think? Chinese is much more likely at the moment …
 
that's what the USA is for
 
It's a shame they have so many characters. Programming was so much easier when all the letters fit into 8 bits.
 
lol
 
i'm just writing this to get another item on the starred list. cause my previous starred comment is now on the way out.
 
10:01 PM
Maybe we can come to a global compromise: we'll all speak Chinese, but first we'll transliterate all the words into the Latin-1 characters.
 
sbi
@AlfPSteinbach We aren't that dumb, you know.
 
lol
I am
 
@sbi oh? just wait for my sock puppet
oh there it was!
oh there it was! :-)
 
@AlfPSteinbach: You can star your own posts ;-)
 
lemme push him down. hmmmm
damn i can't star myself!
 
10:03 PM
@JamesMcNellis Really?!
 
Stay away! I've got a pin and I'll use it!
 
@jball Only room owners can. I think it's a glitch.
 
ah
It's not a bug, it's a feature
 
I can't
star myself, that is
 
sbi
@JamesMcNellis Actually, they can't. But they can abuse the system so they can do anyway
 
10:04 PM
@DeadMG: You need to pin the message then unpin it.
 
What's the point of owning a room if you don't get all the gold stars you want for free
 
haha
 
@jball I like the way my name looks in italics.
 
it just came up saying I couldn't star my own messages
 
sbi
:252124 Close, but not on the spot.
 
10:06 PM
lol
 
hey
 
sbi
@jball Well, you can instantly unstar any message. That's something, you know.
 
I did it
now at the top of the interesting list is the epic statement, "I am"
 
sbi
@DeadMG Now you aren't anymore. :)
 
10:07 PM
aww :(
but if I'm not, then what am I?
 
And now for the next episode of Star Wars!
4
 
@sbi So if you don't get starred, then you can make sure no one else is starred either?
 
the star wars...
 
star wars, rofl
 
@AlfPSteinbach now you're away from my 768x screen vertically xD
lol Alf
 
sbi
10:08 PM
@jball You can make your single-starred message stay in the sidebar by removing all other postings!
 
@sbi Ah the sweet joys of abusable power - it's like the cherry on a sundae!
 
what, kind of pointless?
 
"The Lounge<C++>", starring "sbi". And "sbi" as "sbi"
 
maybe we should be
Lounge<C++>(sbi())
and invoke ourself a most vexing pares
 
Don't make me change the room tagline to "No vexing parses allowed."
2
 
sbi
10:11 PM
room topic changed to Lounge<C++>: No vexing parses allowed.
 
@James Do it – do it!
 
sbi
:)
 
yes :)
 
Ha ha
 
Now you just need to make the room title syntactically valid
 
10:12 PM
lulz
 
Compile-time constants cannot be modified, hence no post-inc
 
we will assume c++0x and a constexpr operator++
 
lol
that can work for me
C++0x is here, nubbinses!
 
@Jo oh, you can overload operators for builtin types now?
or can templates now be user-defined types?
 
who said that C wasn't a UDT?
 
10:13 PM
either way, news to me
 
i sincerely hope so!
 
they can be UDTs now
there are some strange rules about it, but I'm pretty sure that they can be
 
@DeadMG What, the following is valid?!
 
sbi
This is valid.
 
struct foo { };
template <foo F> struct bar { };
 
sbi
10:14 PM
@KonradRudolph Yes, it is.
 
@sbi this is only valid in a nonstatic member function.
 
I’ve come completely out of touch with C++0x since they crossed concepts off the list
 
lol
 
and that was years ago
 
sbi
10:14 PM
@KonradRudolph <shows_tongue/>
 
Konrad, I'm pretty sure it's been valid for ages
 
constexpr struct A { constexpr int operator++(int) { return 42; } } C = {};
template<int> struct Lounge {}; Lounge<C++> lulz;
 
for as long as I've been using C++, at least
 
compiles fine on g++4.6.0
 
which admittedly, isn't an awfully long time
but more than a year
 
10:16 PM
@DeadMG That's practically forever in internet time
 
awesome
 
So, I have a networking question that maybe someone can answer. I moved into a new place yesterday and there is fiber internet. So, I plugged in and I got an IP but I couldn't get to any web pages or log into AIM and such, so I figured I didn't have any service connected yet. But somehow, Steam was able to connect. Any thoughts?
 
template parameters can't be structs/classes though. not in c++0x
 
I have officially been using C++ forever() and am therefore the absolute God opinion on it
 
10:16 PM
konrad@dusk-falcon:~/Projects/0xx$ cat > 0x.cpp
constexpr struct A { constexpr int operator++(int) { return 42; } } C = {};
template<int> struct Lounge {}; Lounge<C++> lulz;

int main() { }
konrad@dusk-falcon:~/Projects/0x$ g++ -std=c++0x -pedantic -Wall 0x.cpp
0x.cpp:2:40: error: 'C' cannot appear in a constant-expression
0x.cpp:2:41: error: an increment cannot appear in a constant-expression
0x.cpp:2:43: error: template argument 1 is invalid
0x.cpp:2:49: error: invalid type in declaration before ';' token
 
what version?
 
room topic changed to Lounge<SeaPlusPlus>: No vexing parses allowed.
 
ewwww
 
@KonradRudolph geordi says "4.6.0 20101113 (experimental)"
 
no way
 
10:17 PM
There. Syntactically valid.
 
put it back
 
konrad@dusk-falcon:~/Projects/0x$ g++ --version
g++ (GCC) 4.5.1
 
yeah
 
@Jo ah
 
he only said valid GCC 4.6.0
 
10:18 PM
puppy will cry
 
room topic changed to Lounge<C++>: No vexing parses allowed.
 
bwahahaha
I might, but the puppy sure won't
 
(Overlooked that)
well, no chance that I’ll install 4.6 now. I’m happy as it is that I can get my library compiling across 3 versions of GCC
 
in fact you can do Lounge<"C++"_lulz>
 
shan’t add a fourth to it
 
10:19 PM
with a constexpr user defined operator function
 
guys, please
let's just leave it how yours truly left it
 
@JamesMcNellis The filter on the connection is based on searching for traffic that matches typical ports/information patterns and steam is non-standard enough to get by it, -or- steam just happens to look too similar to the initial service request traffic for the filter to discriminate that it's not?
 
@jball That could be. I don't know. I was kind of expecting for it to either work completely or not work at all. It was quite unusual. Hopefully they can come hook everything up tomorrow.
 
I love my cable
20 megabit
by the way
what are the limits of C++0x's constexpr?
I assume that I can't start opening files in a constexpr function
 
@DeadMG It has to return a value calculated from other constants.
 
10:28 PM
@JohannesSchaublitb the good thing is that you can use recursion
 
@JohannesSchaublitb Before you can do that, though, you have to use recursion.
 
@JohannesSchaublitb One thing I liked about Andrei's approach was the he provided explicit correspondence between usual iterative constructs and how to do that with templates. And I hope someone will design a langauge where it can be expressed more directly, iterative-like. In the same spirit as monads for hiding uglyness of functional approach
 
@AlfPSteinbach idon't understand. ranges? EDIT: OHH I see now!!
 
@johannes: no. think about iterative expression of factorial. currently we have to translate that to recursive thing with templates, or with constexpr. would be nicer to be able to express it more directly, like the iterative code, but using a language that limits what you can express to what templates can handle
 
10:33 PM
what would be much more interesting
is a compile-time DSL parser
 
@AlfPSteinbach agreed -.-
with recursion + ?:, is it turing complete?
 
@JohannesSchaublitb yeah, but so would the hypothetical language be (hopefully). like, a single-assignment (all variables const) language can be turing complete, yet it restrict what you can express directly, to what is nice good efficient and easy to analyze
Here's an example. A novice wants to write code like

if "type is integer type" { do this } else { do that }

can be mechanically translated to template code with decision at compile time
 
you mean like static_if in D?
 
sbi
But I've been gone for only 30mins! What is it with you guys? Whenever I turn my back, you go right back to discussing C++! Isn't there anything interesting to discuss?
 
@DeadMG possibly, but i don't know D
 
10:43 PM
ok
here's something funny to discuss
on a game forum, some guy thinks he's found the revolution in pathfinding
 
an algorithm that walks along the straight line path, and then follows the edge of obstacles
as opposed to actually finding the optimum path
 
sbi
@AlfPSteinbach Yeah, that's what I feared. I suggest discussing something else than C++, and all you can think of is sex...
 
hey, I'm up for discussing sex
it's not like I get to do anything else sex related :(
 
@sbi that sounds more like a frenchman than a russian
 
sbi
10:46 PM
@DeadMG No, please refrain from discussing sex. I have too many kids already.
 
lol
how many?
 
sbi
@DeadMG Too many. (Nope, I'm not going to release any numbers, but I will admit that I wouldn't say "too many" if I had two or three.)
 
lol
so just one then? :P
-1
A: A cleaner code alternative to polymorphism

DeadMGThe base class is exclusively common functionality. If you want your method to behave differently for different controls, use dynamic_cast. If you want it to act the same for all controls, use a virtual method. This is your problem: What I want is to have just one function to return any ty...

I got downvoted :(
 
@DeadMG compensated
 
thanks
I don't mind being downvoted, I checked my profile and I got one downvote for every two upvotes or something like that
but I hate being downvoted for no explanation
 

« first day (92 days earlier)      last day (4858 days later) »