« first day (327 days earlier)      last day (4612 days later) » 

11:00 AM
@MrAnubis You mean, you don't understand the code, or the code seems crappy in retrospective?
I often have episodes of the second.
 
the last one
 
Past Me is a terrible coder.
 
yes second one
 
Time to refactor!
And then refactor some more!
 
even sometimes i wonder how can i create such good code
 
11:03 AM
hi all i have a question
and i'm too lazy to check it out with comeau online!
is that ok?
 
aha
well it goes like this: in Windows programming using Visual C++ one can write e.g.
    virtual HRESULT __stdcall IOleWindow::GetWindow( HWND * )
    {
        return E_NOTIMPL;
    }
to implement method declared in IOleWindow base class (interface).
 
oh, Windows platform code is always beautiful…
 
is that IOleWindow:: qualification allowed in standard C++?
 
At namespace scope, assuming it's a member function, yes.
 
11:06 AM
@Potatoswatter But then you can't put virtual, can't you?
 
@Potatoswatter Well as you can see from the virtual it's within a class definition.
 
virtual is only allowed on member functions… ?
 
@Potatoswatter Of course. How would it make sense otherwise?
 
I thought virtual was allowed at namespace scope, it's just not meaningful.
 
Quite a lot of specifiers like explicit, inline and virtual can only appear on the declaration.
Makes it easier to have declaration and definition in sync imo.
 
11:08 AM
Yep, C++11 §7.1.2/5: "5 The virtual specifier shall be used only in the initial declaration of a non-static class member function; see 10.3."
So, not in the namespace. Go figure.
 
@AlfPSteinbach Not a clue.
 
Class qualification is certainly not allowed in class scope, anyway.
 
Something with MI? I doubt it...
 
i have some trouble getting Visual C++ to accept this with my own methods, and IntelliSense babbles something about must be pure virtual (even though it is)
it's just that it seems so nice a feature: it tells the reader not only that the definition is an override, but exactly where the original comes from
 
> @Oli: yep, the whole thing's a mess in my opinion. My response is that even if it's legal, I want nothing to do with it. So I won't write it and if I ever write a C or C++ implementation I'd ensure that it works and maybe stick in an astonishingly high-level warning for it. – Steve Jessop 2 mins ago (emphasis mine)
This should be the answer to many of the "Is this crazy shenanigan UB?" questions we see here.
 
11:23 AM
I was pleasantly surprised right now to see that Visual C++ 10.0 implements C++11 override.
However, when I used it I got
warning C4481: nonstandard extension used: override specifier 'override'
 
it's for managed code
 
Isn't that one of those context sensitive pseudo-keywords?
 
@AlfPSteinbach It's not C++11 override, it's C++/CLI override.
I wonder how they will get around all the syntactic conflicts between C++11 and C++/CLI.
 
surprised it even compiles in unmanaged mode
 
Particularly enum class.
 
11:26 AM
msdn lib: "override is also valid when compiling for native targets (without /clr). "
 
I suppose it does the same and they will simply remove the warning for C++11.
 
MetallicPriest user is a pain
you answer a question of his, and then he goes and re asks the same question again, what a nob
-1
Q: Does this need memory fence in x86

MetallicPriestIn x86 multicore processors, Although each core can process instructions Out-of-Order, it still retires the results In-Order. Also x86 multicore processors have cache coherency. With Both In-Order retiring of results and Cache-Coherency in place, do we require a memory fence in this example fro...

pls close
 
@TonyTheTiger You noticed that too, huh?
Sep 2 at 9:48, by R. Martinho Fernandes
Aug 30 at 9:02, by R. Martinho Fernandes
In the past day or two he has repeatedly asked questions similar to "I don't need to synchronize for this, do I?" Everyone tells him "Yes, you need." So he rephrases his question and asks again.
Unfortunately, I didn't notice it was him until I had already answered :(
 
fuck, shouldn't have deleted my BNF grammar
thank you source control... for once
2
 
hehe
@RMartinhoFernandes ugh, annoying
 
11:49 AM
> Could you provide an example of Web craping in C or C++ ? (other solutions are acceptable, when shown how to easily bind with C/C++ code)
lol
 
@RMartinhoFernandes continuing our conversation... does each member of the mixin superclass need a separate using, or can the whole lot be brought in at once?
 
@Mankarse I think each member. It's a pain, really.
 
In that case it doesn't really help for reducing boilerplate, which is the case when mixins are most worthwhile.
Maybe just using a strict naming convention would be the way to go.
Like making all your mixin base-classes be called private_mixin_blah.
 
@Mankarse Yes, I was just pointing out that it was not impossible.
@Mankarse I usually use a detail namespace for that.
 
That is a valid option too.
It doesn't seem strongly preferable to #include "impementation" though.
 
11:58 AM
I agree. Like I said, there's no strict advantage. It's matter of choosing your own poison: MI or preprocessor.
Well, lunch time!
 
Have fun!
 
nomnomcakes
 
ohhhh cakes....
what kinda cakes?
 
obviously, ones made of "nom nom"
wasn't that obvious from the name "nomnomcakes"?
 
12:17 PM
yea I've never heard of a substance called nom nom
 
hmmm
can't seem to instantiate me a vector of unique_ptr
 
oh rly?
 
ya rly
MSVC seems to be instantiating the allocator function that copy constructs, which is obviously not allowed
why it's doing that is another question
ah, fixed'ski
turns out that I forgot to make a move constructor for the class of which it is a member
and MSVC10 doesn't have implicit move constructors which would be applied in this case in a fully compliant compiler
 
Hello?
 
@karantias yes. no. I'm not sure.
 
12:28 PM
Heh, it's still OK :P
 
@karantias Hey, it's Schrodinger's Greeting- it both is and isn't a greeting at the same time
 
Who cares :P
 
I do
having both is awesum
 
That's interesting.
 
12:35 PM
i also find it fascinating
 
So, anyone here having an opensource project?
 
Probably yes
AFAIK, I, Cat, Kerrek, potato have
These are the ones I heard about.
 
Link to github?
 
I don't
 
Or bitbucket?
 
12:39 PM
my ideas might not have much value, but whatever value they do have belongs quite exclusively to me
 
oh gosh
 
PHILOSORAPTOR!
I don't always have good ideas, but when I do, whatever valued they do have belongs quite exclusively to me.
 
copycat
@DeadMG just said that
 
Overheard:
“error: ambitious overload …”
hi all ;)
 
hi
how are ya?
 
12:49 PM
Good morning, everyone
 
1:04 PM
Cool.
 
Disclaimer : jkdl-svg is actually a huge pile of crap, I'm planning of deleting it soon.
 
@kbok How come?
 
i am creating a gui maze generator and maze solver - i had heard that maze can be represented using graph , but i want hint that how do i map a graph node to maze paths junction?
i'm hoping question is clear
 
@MrAnubis A node is an intersection. An edge is a path.
 
@EtiennedeMartel I started writing it and realized that my code actually sucked. This was before reading good C++ books.
 
1:08 PM
@kbok Well, sometimes I go back to the code I wrote a while ago, and man does it sucks.
 
@EtiennedeMartel : but i want to know how do i map this "is" relationship from your sentence -> A node is an intersection
 
If your old code doesn't suck, you didn't learn enough since writing it
2
 
@EtiennedeMartel I think it's a good thing, it shows you did progress.
 
indeed
 
@MrAnubis Eh
 
1:11 PM
-19
Q: Please warn people posting insulting and contentious content that will result in negative consequences

marie martinSomeone told me they hated StackOverflow and Meta StackOverflow. So I got angry logged in and said stupid things. It would be nice if Meta StackOverflow could warn people their question contains insulting and contentious content and posting it will result negative consequences. But then I guess i...

 
@MrAnubis What do you mean "how"?
@kbok What the hell?
 
@EtiennedeMartel i mean mapping
 
@MrAnubis Just create a graph that contains one node for each intersection in your maze and one edge for each path between those intersections.
If you're asking how to detect what is an intersection, then, well, that depends on how your maze is represented.
 
Meta SO is such a strange place.
 
@EtiennedeMartel do you want me to just print the graph? , there must be way so that i can map the edge to gui maze path representing that edge
 
1:16 PM
@MrAnubis I don't want to you to do anything. I don't even know what your architecture looks like. In fact now I'm confused.
 
@EtiennedeMartel Actually i think i am asking the question vaguely , anyway i'll try some search
 
@MrAnubis Yes, and I think asking that on Stack Overflow would be a better idea.
 
Hi - what do you think of using shared_ptr and cstdio as a replacement for fstream, like so:
std::shared_ptr<std::FILE> fp(std::fopen("hello.txt", "wb"), std::fclose);
 
If you want a low-level API, you may want to use a wrapper, but shared_ptrs on C structs... yuck.
 
1:25 PM
Or even auto fp = make_file("hello.txt", "wb").
 
cstdio sucks mightly.
 
Hmm. I heard that people don't like fstream because it's too slow.
 
iostream might not be perfect, but at the very least it beats stdio.
 
Why not write your own RAII file class ?
 
Why isn't this a useful alternative?
@kbok Why write one if shared_ptr provides one already?
 
1:26 PM
What is slow about fstream?
It's I/O, it's always slow.
 
And get thread-safe reference counting for free...
 
@KerrekSB The claim that C++ streams are slow is an old canard
just disable syncing with C streams and see the speed go through the roof
some operations may still be slow but overall they match C streams µs for µs
 
@KonradRudolph I suppose, fair enough. I was just wondering if the shared-pointer construction might be useful.
 
@KonradRudolph he he
 
Maybe I'll ask on codereview...
 
1:28 PM
std::filebuf is also much faster than std::fstream, if you aren't actually doing formatted I/O.
 
Dietmar Kuehl once made an efficient implementation. But I don't think it was complete. Anyway, them streams are slooooooooooooow beasts, due to doing far to f....ng much, like, locale things and such.
 
@KerrekSB Because that's still a C-style API.
 
@Potatoswatter Oh, can you use filebuf directly? I never tried that.
@kbok Fair enough.
 
Hi all
 
hi
 
1:34 PM
Hola
 
@KerrekSB Not only that, you can transparently access the filebuf through the stream object using streambuf_iterator.
 
@Potatoswatter Interesting, I'm just looking it up... so you'd just use sputn to write data?
 
Anyone who knows graph algorithms here?
 
Why bother with ofstream then if that's available...
 
@KerrekSB I only use the iterator.
 
1:35 PM
const int size = 4; int a[size+1]; Does gcc supports this as an extension ?
 
@Mahesh Use vector.
 
Isn't size a compile time constant ?
 
@Mahesh If it's a compile-time constant, it's not an extension.
 
Sometimes const int is a compile-time constant, sometimes it's not. In this case, it is, so that code is standard.
 
@KerrekSB - Yeah. I would definitely prefer vector over array. But just to know what is going on because VS didn't allowed me to do it while gcc passed it
 
sbi
1:37 PM
@KerrekSB All those special stream classes (file/string streams) do is to provide special ctors that allow you to properly initialize the underlying (also specialized) stream buffer. Other than their ctors, they add nothing to std::ostream and std::istream.
 
@Mahesh You need constexpr instead of just const for that.
 
void foo(const int size = 4){ int a[size+1]; } VS 2010 didn't pass the code
 
They also add members open, close, etc. but those are also just streambuf accessors.
 
@Mahesh Because const is meaningless here.
 
@Mahesh No, of course that's not a compile-time constant. Did GCC accept that? What version?
 
1:40 PM
Compiler cannot assume it's a compile-time constant, because you can call it with something other than default value.
 
sbi
@Mahesh Not true. Both VC9 and VC10 accept const int size = 4; int a[size+1]; just fine.
 
GCC had that as an extension since forever.
 
@potatoswatter - the same isn't supported by VS2010
 
@CatPlusPlus It's not an extension. constexpr is not required here.
For example the constants in std::numeric_limits are defined as const int and they can be used in such places.
 
VLAs are an extension.
 
1:41 PM
@Potatoswatter It's a GCC extension for C++, namely C99 variadiac arrays for C++.
 
oh by the way
 
@Mahesh You do realize that this is not what you said earlier?
 
@sbi
18
A: Why am I suspended from chatting for a message that's from May this year?

sbiSome teenager, who never answered a single C++ question on SO, and who was never before seen in the C++ chat room, storms into the room, actively searches the room's history for words and phrases he finds offensive and then goes on a rampage flagging a bunch of old messages. Of course, given just...

 
@AlfPSteinbach Not "variadic". "Variable-length".
 
I fail to see what his age has to do with the issue at hand
 
1:42 PM
@RMartinhoFernandes dah
 
as if people who aren't teenagers never do stupid/immature/etc things
 
@AlfPSteinbach I'm referring to when it's a proper constant, as in sbi's example, not in the example where it's not a constant at all.
 
sbi
@Mahesh That is very different from const int size = 4; int a[size+1];, though.
 
@EtiennedeMartel - What ?
@sbi - How ? Could you explain please ?
 
oh crap, I'm not even a teenager any more :( I feel so old
 
1:43 PM
@Mahesh You gave const int size = 4; int a[size + 1]; as an example... then proceeded to show a bit of code that included a function.
 
sbi
@DeadMG Of course they do. But I have someone of that age in my household, and I can assure you that there is a correlation between maturity and age.
 
@DeadMG I'm surprised a "teenager" would even care... I didn't give a crap who said what when I was a teenager
 
I do miss being able to do stupid things and being just "some teenager." Once I got a free airline ticket just for being young and dumb.
 
of course there is
 
@EtiennedeMartel - Oh.. The same would work for gcc even doing the same in main with out any function
 
1:44 PM
but what matters is what he did, not his age
 
@Mahesh Always always always compile use gcc with -W -Wall -Wextra -pedantic, and don't say that "it works in GCC" unless you don't get any complaints with those options.
 
sbi
@DeadMG I remember the birthday where I thought that the beginning of my youth was a decade ago. By now that, too, is decades ago. :)
 
lol
well, I was going to give you this shpiel about how as a teenager I feel thoroughly offended by your discrimination
 
@DeadMG hormones
 
but I realized that I'm actually not, and had to revise upwards my own opinion of my age from about 18 to what it really is, which is about 21
 
1:45 PM
@KerrekSB - Point taken :)
 
although I still feel that it's very unnecessary for his age to be mentioned
you make it sound as if teenagers should be banned from the site or something
 
@Mahesh The thing is, the link you gave ( ideone.com/5Pk8F ) should not compile.
 
@EtiennedeMartel - Well, with the extra flags set as noted by @KerrekSB
 
sbi
@Mahesh The function can be called with different values, so for each invocation the size will be different. That's something that cannot be easily determined at compile-time. (There's optimizations, but they don't change the language's semantics.) A simple int literal, OTOH, is fixed at compile-time and will never change, so the compiler knows the value at compile-time.
 
what are the advantages of using C# over VB .NET? I like C# , but VB .NET is easier and I have heard they both produce the same IL
 
1:48 PM
@IntermediateHacker Technically, none.
They do produce the same IL, however, new features seem to be added to C# first and then to VB.NET if its users whine enough.
Also, C# has better support for interop.
 
@EtiennedeMartel VB.NET has more support for COM interop.
 
@RMartinhoFernandes Hmm?
 
Correction: had. Now I believe they're on par.
 
@sbi - Thanks. But if a function parameter is const qualified, some thing adding to it is also a constant ( if not taken the result to a variable ). So what is the problem of using it as the array size directly.
 
Aaaah. Yes, indeed, but with C# 4...
 
1:50 PM
@sbi - Learnt another internet slang - OTOH = On The Other Hand :)
 
@Mahesh It's const qualified, but not a compile-time constant.
 
sbi
@DeadMG No, they shouldn't be banned. But of course the age of the guy, as well as the fact that he's never answered a C++ question and had never been seen here, is invoked here to undermine the victim's credibility. All three show the guy has little experience, while the fact that those banned are regulars nicely contrast with that. (Didn't you know that yourself? I'm baffled that I have to give you a rhetoric 101 here.)
 
no, I got the other points just fine
 
sbi
@Mahesh I used to be active in Usenet, and get often called out for using such beasts.
 
it's just the age thing I object to
an idea or action is the same regardless of whom it originated from
 
sbi
1:52 PM
@Mahesh Whether the parameter is const or not doesn't matter here. Even if const it will differ between invocations, and is thus a run-time constant.
 
@sbi Perfect.
 
anyway
 
@Mahesh Try passing a non-const value to that foo function.
 
Chances are, in any case, the dirtywork was done by an ill-conceived bot.
 
if you decide not to remove it, then it doesn't matter much
 
1:53 PM
@CatPlusPlus Thanks
 
@Mahesh Learn the geekiest one: OTGH: on the gripping hand.
 
@DeadMG then make a comment on the answer you linked to
no one else complained though
 
sbi
@DeadMG No, it isn't. (If I mock Germans it's something completely different than when you do it. If I call you a nazi it's got a different undertone than when you call me, a German, a nazi.)
2
 
personally, I'd like to think that me calling you a nazi is no different to you calling me a nazi
 
sbi
@DeadMG Age correlates to experience, maturity, wisdom. You might not like it, but it's a fact nonetheless.
 
1:55 PM
sure, but it's not specific
 
@RMartinhoFernandes Interesting
 
Help, that's what you get for trying to be helpful... :-S
 
if I call you a Nazi, then the fact that you are a German is directly related
 
sbi
@DeadMG See, you just illustrated the very point I made about experience, maturity, and wisdom. :)
 
but his age isn't related at all to what happened, it's just some random fact about him
 
1:55 PM
I like to think my maturity is in dog years
 
@sbi Actually, I think it's more about age, in terms of direct relation to the period in question. You're a lot older than me, so from my perspective, Nazis really existed a significantly longer time ago, which undoubtedly produces a significantly lesser impact for me.
 
Oh, I see Goldfarb's law is already in effect...
 
It's "Godwin".
 
> THX!! REALLY APPRECIATE:)
 
sbi
 
1:57 PM
@KerrekSB What's the deal with this guy, lol
 
@sbi No, this one...
@kbok Yeah ... I mean, I did once help someone through some code for an extended period, but he was observant, motivated and prepared to do his own research. But that guy...
 
@kbok The deal is very simple "I need someone to do my work for me because I can't do shit."
 
@KerrekSB I say don't bother.
 
sbi
@DeadMG LOL! Even my parents where born after the war. For me it's the grandparent generation, and I presume it's the same for me. No, that doesn't count.
 
@EtiennedeMartel Definitely not. That's a total minefield. Anything you'd suggest would precipitate a whole new onslaught of questions.
 

« first day (327 days earlier)      last day (4612 days later) »