« first day (322 days earlier)      last day (4609 days later) » 

Xeo
1:05 AM
Daaaamn
I was away from the scene for way too long. So many new videos to download from C9 alone...
 
I almost never watch those, I have no idea what I'm missing on.
 
Xeo
C++ and Beyond 2011?
 
@Xeo That doesn't tell me what it's about.
 
Xeo
Well, C++, obviously. :D
 
Xeo
1:29 AM
Yay, it's down. ♥
 
 
5 hours later…
6:17 AM
@Xeo The shorter ones aren't that interesting.
The Meyers/Alexandrescu/Sutter talk is gold, of course.
@ManofOneWay If by "new standard" you mean C++11, there isn't any book out on it yet, so buying Accelerated C++ is still one of your best options.
 
6:58 AM
Information hiding the Microsoft way:
1>------ Build started: Project: clock_toolbar, Configuration: Debug Win32 ------
1>clock_toolbar.def : warning LNK4104: export of symbol 'DllCanUnloadNow' should be PRIVATE
1>clock_toolbar.def : warning LNK4104: export of symbol 'DllGetClassObject' should be PRIVATE
1>clock_toolbar.def : warning LNK4104: export of symbol 'DllRegisterServer' should be PRIVATE
1>clock_toolbar.def : warning LNK4104: export of symbol 'DllUnregisterServer' should be PRIVATE
1>     Creating library D:\dev\utility\clock_toolbar\Debug\clock_toolbar.lib and object D:\dev\utility\clock_toolbar\Debug\clock_toolbar.exp
Essentially, adding the PRIVATE that the MS linker insists on, removes these functions from the generated import library, so that any module accessing the DLL via that import library is prevented from calling any of the functions directly and efficiently.
For example, a test program will then have to use GetProcAddress.
 
7:13 AM
.
"the Regsvr32.exe file in the System32 folder is a 64-bit version" - Microsoft
2
 
Haha I had that problem not long ago.
Trying to get something to run under Wine except a dll was missing -- figured I would just pick it from one of my Windows install.
Turned out, it was 64 bit.
 
7:54 AM
@AlfPSteinbach and the taskmanager under SysWow64 is the 32-bit one, while the one under system32 is the 64-bit version
Oh, and the 64-bit version is only able to generate 64-bit minidumps of 32-bit processes, which makes them unusable for debugging.
 
8:06 AM
@FredOverflow I really don't know what kind of answers your recent lambda question can expect :(
 
why do i get the feeling that java is dying away?
seriously, is it dying away?
 
8:25 AM
No major language is dying away any time soon. There's simply too much code bases to maintain.
@LucDanton There are languages where returning from inside a closure works, right?
 
@FredOverflow Yes; I wouldn't call them closures though.
I'd wager Perl does that but what can't Perl do?
 
What about Scala? Does it work in Scala?
 
I know too little about it.
Also IIRC those languages that do allow those kinds of things may have two kinds of 'closures': the regular ones, and those that have 'weak' scoping or whatever you want to call it.
 
15
Q: Is non-local return in Scala new?

Jean-Philippe PelletA colleague just showed me this and I was surprised that it compiled at all: def toUpper(s: Option[String]): String = { s.getOrElse(return "default").toUpperCase // ^^^^^^ // a return here in the closure?? } and this even works: println(toUpper(Some("text"))) // TEXT println(toU...

@LucDanton It works by throwing an exception under the covers. Exactly what I was pondering as a possible (albeit ugly) "solution" in my question :)
Any insights into this question?
12
Q: May I treat a 2D array as a contiguous 1D array?

FredOverflowConsider the following code: int a[25][80]; a[0][1234] = 56; int* p = &a[0][0]; p[1234] = 56; Does the second line invoke undefined behavior? How about the fourth line?

Everybody seems to agree that it's possible, except for a comment that I find quite convincing:
> §5.7/5 "When an expression that has integral type is added to or subtracted from a pointer, the result has the type of the pointer operand. If the pointer operand points to an element of an array object, and the array is large enough, the result points to an element offset from the original element such that the difference of the subscripts of the resulting and original array elements equals the integral expression."
> (emphasis mine) Is this relevant? Specially given the fact that the first array object (a[0]) is not large enough for the index 1234.
 
Also my answer
 
8:40 AM
@FredOverflow I meant "any new insights", of course.
 
I missed that!
 
@LucDanton Right, I'll accept yours for now.
@LucDanton The absence of "new" in my first question is easily explained: C++ programmers almost never use new in their programs either ;)
 
Makes sense to me!
 
I think the question you must ask for the purely formal is, is it possible to create a really perverse implementation that will foil up things?
And I think, yes, that's possible, with "phat pointers".
 
@AlfPSteinbach You mean concerning the 2D arrays or the non-local returns?
 
8:46 AM
2D arrays
so I think in the most academically pure formal you're screwed
 
What's a "phat pointer"?
 
that's a pointer with additional info about valid range etc.
it's like a pointer with UB detector
 
I'm surprised @Johannes hasn't answered "UB!" yet. Normally, he is one of the first.
 
:)
but in practice you're saved by the fact that if anyone should produce such a grossly perverse implementation, you can simply choose to not support that implementation
 
@FredOverflow On the other hand, he would simultaneously bring funny code like if(&p[80] == &a[1][0]) /* use p[80] here */
 
8:49 AM
type error, right?
 
Should be fixed?
int* comparison
 
The former is a pointer to an array, the latter a pointer to an int => type error
Get rid of the first &.
 
int* p; vs int a[80][I forgot how many]
p[80] is int&, so &p[80] is int*
 
Oh wait, I didn't see the p, I saw two as. My mistake.
 
Anyway Johannes brought that to be with T a[1], b; if(&a[1] == &b) ... or something similar.
 
8:54 AM
while we're discussing subtleties ...
in a header file you might want to place T const& r = something;; does that have extern linkage?
 
Do references have linkage? What with their non-object status?
Ah, linkage is for names.
Function aren't objects!
 
@AlfPSteinbach My first guess would be since references are conceptually "const", they always have internal linkage. But that's just a shot in the blue.
 
A name having namespace scope (3.3.6) has internal linkage if it is the name of
— a variable, function or function template that is explicitly declared static; or,
— a variable that is explicitly declared const or constexpr and neither explicitly declared extern nor
previously declared to have external linkage; or
— a data member of an anonymous union.
So I guess not :)
 
Personally, I don't use references for anything other than parameter passing (and value returning).
@LucDanton Beware, named references are variables in C++0x.
 
but if it has extern linkage, how to make that internal linkage?
 
8:58 AM
@FredOverflow explicitly declared const is what I consider relevant.
Which I find spooky.
 
@AlfPSteinbach Either declare it static or put it in an anonymous namespace.
 
Consider at namespace scope:
int const totally_internal = 42;
decltype(totally_internal) now_what = 42;
 
@FredOverflow Anonynous namespace != internal linkage
So it's the superior alternative to obtain the same result, but doesn't answer Alf's riddle.
 
OK, anyway, here's the code I was writing. This is in a header for a DLL. Strictly hobby:
namespace clockToolbar {

    namespace detail {
        template< class Dummy >
        struct FatConstants_
        {
            static GUID const classId;
        };

        // {59194BA0-B0A6-4252-A5BB-E2B308D36F12}
        template< class Dummy >
        GUID const FatConstants_<Dummy>::classId =
        { 0x59194ba0, 0xb0a6, 0x4252, { 0xa5, 0xbb, 0xe2, 0xb3, 0x8, 0xd3, 0x6f, 0x12 } };

        typedef FatConstants_<void> FatConstants;
    }

    GUID const& classId = detail::FatConstants::classId;
 
9:04 AM
@LucDanton just learned something new
 
@FredOverflow Unsurprisingly, GCC is one implementation that does use internal linkage for things declared inside anonynous namespaces.
@AlfPSteinbach No linker error or misbehaviour?
 
@LucDanton I doubt we will ever see a 100% conforming C++ compiler. The language is just too damn complex.
 
@LucDanton I haven't got to the point where header is used in more than one translation unit. I am fairly sure that it's internal linkage for that reference. But I'm not 100%.
 
Why do you have a reference in a header in the first place? Is that really nevessary?
 
@FredOverflow it serves up a simple name while avoiding data or code duplication. it's a standard-conforming alternative to toolchain-specific "discardable linker record".
An alternative is to use an inline function and force a function call on client code.
 
9:11 AM
I'd probably do exactly that.
 
yes, i think i will do that. it's just that i find it interesting to investigate corner functionality. sometimes it pays off. ;-)
 
@FredOverflow Poor choice of words -- what GCC does is treat the variable as a 'private' symbol, just like it does when handling internal linkage (C++ meaning) names. But at the same time, it correctly deals with template parameter which are required to have external linkage (GCC supports internal linkage objects as template parameters -- which was relaxed for C++0x) so it falls under the 'as-if' rule.
 
@x4d33746153706c306974 has a funny name
 
Or rather, x4d33746153706c306974 is a funny name.
 
9:15 AM
its not funny , it means M3taSpl0it
exploit kit framework
 
Oh, we have already met once:
13
Q: Real life examples of xvalues, glvalues, and prvalues?

x4d33746153706c306974I was wondering if anyone could tell or explain some real life examples of xvalues, glvalues, and prvalues?. I have read a similar question : What are rvalues, lvalues, xvalues, glvalues, and prvalues? but I did not understand what everyone meant. Can anyone explain in what cases these values a...

 
namespace clockToolbar {

    // {59194BA0-B0A6-4252-A5BB-E2B308D36F12}
    inline CLSID const& classId()
    {
        static GUID const theId =
        {
            0x59194ba0, 0xb0a6, 0x4252,
            { 0xa5, 0xbb, 0xe2, 0xb3, 0x8, 0xd3, 0x6f, 0x12 }
        };
        return theId;
    }
}
 
@AlfPSteinbach That's the typical pattern, yes.
 
@FredOverflow your mind is very fast)
 
9:17 AM
@x4d33746153706c306974 I just clicked on your gravatar and saw the question.
 
you cheater:)
don't mind:)
 
I'm just lazy. Probably too much Hakell coding lately :)
 
Hi @FredOverflow
 
@FredOverflow : you should hear this for freshment : 4shared.com/audio/ipiN2AhK/11_The_Black_Keys_-_Howlin_For.html
 
@Mahesh Greetings fellow rice eater and chess player ;)
 
9:20 AM
Chess player ?
How do u know that ?
 
You were the one with the rice chess "optimal path" problem, weren't you?
 
lol
@FredOverflow : did you hear the song?
 
@FredOverflow ohhhh
 
Yes, not my kind of music. I prefer music that numbs your mind.
I find that very relaxing.
 
Omg , you call that relaxing?
not my type
 
9:24 AM
In a way, yes. Takes my mind off things.
 
the song which had pasted was from limitless movie
 
@FredOverflow - Are u interested in playing chess ?
 
very awesome movie
you must watch it
 
@Mahesh I really suck at chess. But I like solving recursive chess problems.
 
@FredOverflow : Have you seen movies "Limitless" -> imdb.com/title/tt1219289
 
9:26 AM
@x4d33746153706c306974 Nope, is it any good? I'm more of a TV series kind of guy.
 
@FredOverflow - Yesterday, I talked to an employee. He said their company doesn't use STL because it is increasing their executable size considerably
How far this is true ?
 
sbi
@FredOverflow I should have known from your hairstyle that you're a metal fan, really.
 
@FredOverflow : Indeed very good movie trust me
 
@Mahesh Google "template bloat".
 
@sbi : true
 
9:27 AM
@sbi Insect Warfare isn't Metal, it's Grindcore.
 
But it's unlikely that any other general purpose library will produce smaller code.
 
sbi
@FredOverflow All the same. In 30 years, I have seen metal styles come and go, and that's just another kind of it.
 
@FredOverflow He even said they prefer printf over cout for the very same reason.
 
One advantage of Generics (C#) over Templates (C++) is that the former produces far less code than the latter. But then, Generics can't optimize on a per-type basis.
 
9:30 AM
I didn't argue because he is an experienced guy
 
@FredOverflow woah, cool :)
morning all, btw
 
@sbi Oh, are/were you ever into Metal? What kind of style would you say this is? :)
 
Ohai.
 
sbi
@FredOverflow I was, for a brief period, in my teens. Mostly hard rock, but some metal, too.
 
@FredOverflow what kind of metal are you most into?
 
9:34 AM
@sbi Maybe you didn't explore enough of it and that's why you became so grumpy? ;)
@TonyTheTiger I don't listen to much music in general, anymore. Sometimes weeks pass without a single song being played. But when I do, it mostly ends up being Death Metal.
 
@FredOverflow oh cool :)
 
Nowadays, my media interest is more focused on TV series, programming videos and podcasts.
 
just in the spirit of posting random things i encounter
 
oh btw, that video I posted yesterday from Channel 9, I watched it, it was very interesting :)
 
For example, I like to listen to SE radio podcasts on the train.
@TonyTheTiger What was it again, something about compilers?
 
9:38 AM
@FredOverflow yea about the C++ backend compiler
not very at home in compiler land, so it was kinda cool to get to see a bit how it gets done
 
Hope you guys like this music - youtube.com/watch?v=-PL00SCVBZE
 
I'm gonna watch STL's talk about nullptr, once started watching it, but never finished.
 
@Mahesh Nice! Reminds me of this one:
well, at least a little :)
 
@FredOverflow - Have you heard it till the end ?
 
No, but it's still playing. Like it so far.
 
9:41 AM
Last 2 mins will be awesome
 
sbi
@Mahesh I'm not overly fond of the sitar, but that guy plays very well, and it's great to hear them play together. I like that.
 
Oh, there's an electric guitar also. Didn't notice before :)
 
sbi
@FredOverflow The only thing these two have in common is that they are slower, less noisy, kinds of music than what you here otherwise.
 
The silverchair video has an "oriental" feel to it, methinks.
 
sbi
@FredOverflow Actually it was more the other way around.
I got into metal deep enough to see how shallow it actually is. When you have something important to say, and are able to say it well, you don't need to yell it at your audience.
There's a few things I still like (and a few CDs I bought out of sheer nostalgia) but not too much.
Anyway, gotta go now. See you later.
 
9:44 AM
@TonyTheTiger how much is there to say about nullptr? "It's a type safe null pointer. The end" ;)
2
 
I don't think Metal was ever supposed to be a deep intellectual thing :)
 
@sbi - You might have heard of the guy playing piano. He is A.R. Rahman
Oscar winner for Slumdog Millioniare
 
@sbi You might like this then:
 
Hey
What a cool feature - chating rooms. My first time here
Can someone help me out explore all stackoverflow features/site? I got a bit confused...
what questions do I post where?
What is more appropiate to forum posting and what questions are posted in the chat rooms ?
I konw there are also other stackoverflow sites. Can someone name them all?
 
@EladBenda What is "chating", a blend between chatting and mating?
 
9:47 AM
@EladBenda why don't you just go look? stackexchange.com/sites
 
@jalf I will
@FredOverflow typo. my bad
@jalf And how about: What is more appropiate to forum posting and what questions are posted in the chat rooms ?
 
@EladBenda the sites themselves (they're not forums, but Q&A sites) are for questions and answers
the chat is for chatting :)
 
@FredOverflow Nice, another Porcupine Tree fan.
 
@jalf right, though the rooms are topic related. So I guess people would help each other in technial issues here as well, no?
@jalf Forgive me for being novice, ya?
 
@RMartinhoFernandes I only have two albums, so I wouldn't consider myself a fan. But I really like what I've heard so far.
@EladBenda You can ask small C++ questions here. But mainly, we discuss completely unrelated topics. Most "real" C++ questions are better off on SO.
 
9:54 AM
@FredOverflow how did you link to an outter question here?
 
You post the link.
 
@EladBenda Just post the link here without anything else before or after it.
 
The system takes care of the rest.
 
Thanks guys
see you around
 
@EladBenda Have you read the newbie hints?
 
9:55 AM
no, recommended stuff I guess
@RMartinhoFernandes is this a blog about the chat rooms?
 
@EladBenda well, no one is stopping you from asking questions here. But you generally won't get as good answers
this room is really just a bunch of C++ people slacking off and talking about whatever they like
 
@jalf K
 
if you're lucky, some of us might answer a C++ question asked here. Or we might change the subject to something completely random instead
 
Yes, we have a random subject spinner thingy.
It's right there, next to the time machine.
 
@EladBenda sure, hope you didn't percieve what I said as an attack on you. I was just trying to explain how it works :)
 
9:58 AM
@jalf visa versa. You helped me a lot
@RMartinhoFernandes what time machine? what random spinner?
 
@RMartinhoFernandes We do? How is a topic spun?
 
srand(time(0));   // there, both in one line of code!
 
/me wants a demo
 

« first day (322 days earlier)      last day (4609 days later) »