« first day (174 days earlier)      last day (4764 days later) » 

10:03 AM
@JamesMcNellis That's great... I miss having a greater community around here. I did not go to the Dublin meeting, but there were only two people that I had never seen around in SO. The only other two people that I know in SO in Dublin that have something to do with C++ are a coworker, with whom I already have coffee everyday, and There's Nothing... and I don't really feel the need to know him in person.
 
@DeadMG now, if wchar_t* had an operator wchar_t*, that might make sense
oh wait. ur ignoring me. sigh
 
@tina hello
@tina true :)
@tina I don't know much about Hidden Markov Models
 
sbi
@DeadMG I seriously doubt that there's a wchar_t*::operator wchar_t*(). :)
 
@sbi would seem a bit pointless to me
@tina why is that?
 
sbi
@ChrisBecke Maybe that would be a very good moment for reflection and considering changes?
 
10:13 AM
@sbi im not too sure that I care that DeadMG cant read me.
 
sbi
@tina: I haven't seen @Alf around here for quite a few days.
 
@ChrisBecke perhaps that's where the problem starts...
 
sbi
And have you installed a spell checker? Your spelling seems to have improved significantly.
 
@tina maybe he's just busy and hasn't got much time to spend here
 
@Tony sbi and I have at least one thing in common. we are grumpy old men.
 
cpx
10:15 AM
class A {

public:
	A() { }
};


class B : public A {

public:
	B() : A() { }
};


class C : public B {

public:
	C() : A() { }
};
what could be the reason I cannot call class A's constructor from class C?
 
sbi
@ChrisBecke And you don't care what the rest of us think about you either? Then why are you even here? And: If everyone else seems to be driving the wrong way on the highway, it might be time to consider you might have taken a wrong turn.
 
@cpx B is the direct descendant?
 
@sbi good point!
 
@sbi I am here to learn.
and ill make my opinion known, if anyone cares to read it.
 
sbi
@ChrisBecke And we have at least one thing not in common: I care for @DeadMG's opinion. That's because he's shared very valuable ones here.
 
10:19 AM
@sbi I'll remind you that I havnt ignored DeadMG, he ignored me
 
sbi
@ChrisBecke I'm the last one to hold back my opinion. (FWIW, at the Berlin meetup I was greeted by @balpha with word from Jeff, asking me to be less of a nuisance.) But there's a difference between voicing an opinion and blurting out your ignorance as a divine message, daring anyone to disagree.
 
cpx
Can I just ignore the initialization of class B's object?
 
@cpx What do you mean by "ignore the initialization of B"?
 
sbi
@ChrisBecke Yes. And when that happened to me (did I mention I have spent more than a decade on Usenet?), I took that as a reason to reflect upon myself, not on others.
 
If you were able to skip B construction you would be creating a partly initialized object, and that would be problematic
 
cpx
10:21 AM
@DavidRodríguezdribeas I don't want to call class B's constructor.
 
@cpx then give B a different empty contructor
and call through that.
 
If C derives from B, then to initialize C you need to initialize all subobjects of C, and that includes B
 
sbi
@cpx Don't ask about negotiating a specific way you chose, ask about the goal you need to arrive at.
 
@sbi I'm not sure why you attempt to have this discussion when the past has proven time and time again, that he does not seem to listen or grasp what we are saying. He's just stuck with his own POV and can't seem to look at another's POV or even facts
 
@cpx Still, what you should do is state the problem you want to solve, rather than asking about the particular solution you have
That is, why do you not want to call B constructor? How is it that you want to derive from it but don't want the subobject to be constructed?
 
10:28 AM
can anybody explain what is wrong here: pastebin.com/Q4x9hvuD
I don't get it?
 
sbi
@Tony Here's an insight that comes with age: You discover how much you have been yourself what you despise in others. :) And, really, this is about the most civilized discussion we've had with him about him. So there's hope.
 
@sbi OK, no problem. :)
 
sbi
@Tony Please turn your code into something that reproduces the error. The code you've shown has other errors: ideone.com/jCVQg
 
@sbi: It's likely the ATL class wrapper for BSTR then
 
@sbi this better? pastebin.com/VfbeVQWN
 
10:34 AM
@Tony u still need to define Other before Derived
 
@sbi I have only one class in the morning and the rest of Friday is weekend!
 
sbi
@Tony A bit. Note how this compiles fine, and only fails linking. So the code you provided does not reproduce the error.
@PiotrLegnica Well, I have only one thing to do, too, but that's work and today it lasts about from 11-8. :(
 
@GMan whuh?
 
sbi
@jalf I'm sure you can do better than that. :)
 
@sbi bwah, linking errors are not my best skill
 
sbi
10:40 AM
@Tony It's just that the one method isn't implemented. And, anyway, linking errors come after compilation has succeeded, whereas you were referring to a compilation error.
 
@sbi this one links & compiles and for some odd reason does not produce the error my compiler produces... :( ideone.com/kbql5
 
sbi
My point is that the code you've shown doesn't reproduce the error. In 99% of all cases you will find the problem yourself while trying to distill it into a small, self-contained repro case. In the remaining 1%, you have the perfect piece of code to ask us about.
2
@Tony Your compiler fails at compiling exactly that code?? Which compiler would that be?
 
@sbi Yea you're right, I've found the error....
I have a function error() in my code and a variable error_, and I was passing the function instead of the variable.... silly mistake
 
Also, it makes sense to use ideone instead of pastebin, as that allows you to actually compile and see the exact error with the line and all...
 
sbi
@Tony :)
 
10:43 AM
It helps others helping you
 
@DavidRodríguezdribeas true :)
 
sbi
@Tony That's what usually happens when you distill your code into a repro.
 
@sbi seems like a good way to find errors then :)
 
sbi
@Tony You know, once in a while the Grumpy Old Man happens to blurt out something that's very close to being true. :)
 
BTW, it is interesting to pay attention to the actual errors. The compiler might not be the best at telling you what you did wrong, but it will hint you into what it is understanding from your code:
cannot convert parameter from std::string(void) to std::string&
 
cpx
10:47 AM
@DavidRodríguezdribeas I was wondering why i couldn't do that. I provided the default arguments to the base B class's constructor.
 
std::string(void) is a callable entity that takes no arguments and returns a string
 
cpx
Sorry, I had lost my connection.
 
@DavidRodríguezdribeas ahhh that's what the (void) signifies... smart! hadn't paid attention to that! :) thx
 
First think I thought when I saw your error is that you had hit the a version of the most-vexing-parse, but I could not see it in your code
 
@sbi yes you do and I appreciate it, I've learned something valuable! ;)
 
sbi
10:48 AM
@Tony It's an old leftover from C, where functions taking no arguments were declared as taking a void argument. VC is still using that convention.
 
std::string a(); a = std::string("Hi"); will probably (I have not tried to compile it) give some similar error in the other direction: cannot convert from std::string to std::string(void)
as a is actually a function declaration, not a string initialized to empty
@cpx well, you cannot do it because in most non-trivial examples, the B subobject in C would be uninitialized... and that means that in many cases you will run into problems. Consider if B added a pointer, and that pointer was initialized in the default constructor to 0... now if C constructor skipped that constructor the pointer would be uninitialized, and any code that might depend on that pointer being either set to a valid address or to 0 would fail
with UB
 
so how is this a " the construct S() in a declaration context can also be an abstract declarator (a declarator without an identifier) meaning: a function with no parameters returning S by value"
struct S {
     S();
};
struct T {
  T(const S& );
};                                                                                                                                T v( S() ); // this construct?
returning S by value? huh, S is an arg to a function v? and it isn't passed by ref?
how can it be a return value
I was just looking up what "most vexing parse" is that @DavidRodríguezdribeas alluded to earlier
 
@sbi but then I'd have to read chat logs from 8 hours ago. This will have to suffice ;)
 
sbi
@jalf Ah, yeah, don't we all know that...
@Tony Isn't that declaring a function v, taking a single parameter of type S, returning T?
 
@sbi not per this article that's explaining the most vexing parse
 
11:02 AM
The construct commented as "this construct?" will be parsed as:
typedef S __func1(void);
T v( __func1 );
 
Actually there is some more magic in between as the function type will be converted to a function pointer in the parameters of the declaration of `v`, and it will acutally be:
T v( __func1* );
 
@DavidRodríguezdribeas the compiler will do that conversion?
 
Functions cannot be passed as arguments as arrays cannot be passed as arguments, there are a few conversions that are implicitly done by the compiler from what you write to what it processes:
void f( const int, int a[10], __func1 );
declares a function:
void f( int, int *, __func1* )
I am probably forgetting some other things that are translated there...
Functions are not first-class citizens in C++, and you cannot pass them as arguments to other functions, but you can pass pointers to functions, and in most cases that is what you want, so the language provides weird hidden transformations:

typedef void func(); // declare the type
func f; // declare f as void f();
void foo( func x ); // declares void foo( func* )
int main() {
   foo( f ); // calls foo( &f )
}
 
C++ likes trolling.
 
11:54 AM
@cpx Perhaps you want implement class B as a "mixin" here? Perhaps this post will be of help to you: stackoverflow.com/questions/5426924/…
The key is adding constructor overloads like this:

B() {}

template<class Arg0>
B(Arg0 & arg0) : A(arg0) { }

template<class Arg0, class Arg1>
B(Arg0 & arg0, Arg1 & arg1) : A(arg0, arg1) { }

template<class Arg0, class Arg1, class Arg2>
B(Arg0 & arg0, Arg1 & arg1, Arg2 & arg2) : A(arg0, arg1, arg2) { }

 
12:12 PM
possible
well, c++ is much faster ->videogames, low level but not too much -> operative sistems, general purpose and portable -> you can do everything
 
12:32 PM
everybody gone into friday mode or something?
 
if I have a complex if statement like if(a < 5 && b > 10) will the code normally be compiled so that if a >= 5 that the b > 10 check will not be made? as if it where a set of nested if statements? It seems like the sensible way for it to actually happen... but you know
 
@thecoshman perhaps, I don't know...
 
@Tony it seems like the best for for it to do, as the compile will first convert it to the form if(a < 5){ if (b > 10){ /* code */ } }
 
@thecoshman Yes. That's called short-circuit evaluation. You can rely on it for things like ptr != NULL && ptr->value, || behaves in the same way. That's one of the reasons for which overloading && and || is often a bad idea.
 
@thecoshman yes, the only thing a compiler can choose is the order which expressions are evaluated i thinl
 
12:43 PM
@thecoshman Yes this enables you to write code like this: b != 0 && a/b
 
Note that short circuit evaluation is not mandated in all languages. I assume it is in C derived one, but AFAIR, Pascal was silent on this subject. Ada (I assume VHDL and SQL inherit them) has operators pairs and and and then, or and or else.
 
Thanks guys
I love this place :D
 
Note also that this means that things like i++ != 0 && f(i) are well defined.
 
@AProgrammer How is that well defined: i++ != 0? I thought i++ as that has no sequence point? or is the != a sequence point?
 
&& has a sequence point, like || and ,.
 
12:51 PM
i++ != 0 is like i != 0; i++
 
(Well, operator, not the coma separating arguments in a function call.)
 
@AProgrammer ok thx for clarifying :)
 
I should us more of these in my code: msdn.microsoft.com/en-us/library/chzkfc23.aspx
 
f(i,i++) is ub for example
 
oh, am I right in saying that if in "foo.h" you include "bar.h", when you change "bar.h" or "bar.cpp", "foo.h" (and "foo.cpp") will need to be recompiled. but if "foo.h" just has an empty class deceleration along the lines of class bar{}; then "foo.h" will not need to be compiled into an .o just because the code for bar has changed?
@tina yo
 
1:06 PM
@tina hi
 
sbi
@Tony What do you want? This currently is the room with the highest number of logged-in users.
 
@sbi just wondering what the silence was about... that's all. There was so much activity earlier and then it went silent
 
@sbi I thought it was feeling a bit cramped :P
 
sbi
@Tony I suppose those East Coast Americans just arrived at work, the West Coasters are not yet awake, and the Europeans are actually working.
 
@sbi you're probably right
 
sbi
1:20 PM
@Tony Nah, I'm just trying to make up a theory to support empirical data. :) Many of the participants here are students, and can chat all day if they want. Other days it's much more busy.
Well, OTOH, it seems you asked just during the typical brief daily drop period in the room's activity.
Europeans have lunch, East Coasters have breakfast, and West Coasters are asleep. :)
 
cpx
@StackedCrooked Now, I'm starting to think that it shows your score when you post at least 4 lines of message :S
 
I'm a student
 
sbi
@DeadMG We know. :)
 
@sbi: By the way, I happen to be currently in "full-time" education
 
sbi
@cpx I suppose you're referring to this message (or one in the discussion following it):
9 hours ago, by cpx
How come some people have their reputation score turned off while in chat?
@cpx: I didn't understand the question. What are you asking about?
@DeadMG Which means?
 
1:25 PM
@sbi: It means I'm a student
 
sbi
@DeadMG Yeah, I said I know that. I'm just not sure what you were trying to tell me with your statement.
 
@sbi yea true, students can slack, we still have to do some work :)
 
@sbi: It was a joke
 
sbi
@Tony No, it's just a difference whether you're at home, working at your own pace, or sitting at work, sharing your room with cow-workers who keep asking you questions, try to drag you into meetings, and might think wrong of you when you chat during working hours...
@DeadMG I'm sorry to say that it went completely over my head.
 
Interestingly, it is UB or not depending on the signature of f. If f takes the first argument by reference, then it is perfectly defined:
void foo( int const & a, int b ) { std::cout << a << ", " << b << std::endl; }
int i = 0;
foo( i, i++ ); // will print 1,1
 
1:28 PM
@sbi: I noticed
 
@sbi Soon I'll be working only from home, that will give me peace & quiet ;) hehe
 
@sbi Talk for yourself... many in Europeans will be just procrastinating and waiting to get out of work
 
I wonder what SO's question's growth rate would be?
 
sbi
@Tony Actually I never liked working at home. There's too much to distract you, the kids (when at home) are tugging at my sleeves, and it's hard to really quit working. When I commute to and from work, I have enough time to switch my mind to work/home mode. When I arrive at home, work's long ago. When at home, this doesn't work.
 
@DavidRodríguezdribeas how so?
 
1:32 PM
@sbi I don't have kids or wife, just a father, but he's gone too during the day, so for me that's ok to work from home actually :)
 
sbi
@DavidRodríguezdribeas I have a hard time parsing and digesting this, but if it means what I think it means:
Apr 4 at 20:38, by sbi
I must remember not to put things off. Procrastinate now, don't put it off!
 
cpx
@sbi Yes.
@sbi I was asking about the visibility of reputation score under our names on the left.
 
by the way
am I the only one who thinks that PIMPL sucks?
 
sbi
@Tony Yeah. Some people seem to get along quite well doing so. (During the meetup, @balpha said he works from home all the time, using chat and skype to keep in contact.) I didn't. I have a hard time stopping thinking of work problems when at home, despite 1hr commuting time.
 
@DeadMG I view it as a workaround, so yeah, kinda sucks. But better than nothing.
 
1:35 PM
just use an interface instad
 
@DeadMG I find it useful to deal with conflicting headers.
 
sbi
@cpx Ah, that. I think it depends on the space available. When you type several consecutive, or longer messages, there's more space and thus a bigger icon and additional information is shown.
 
@tina what is LUT? (you should explain your acronyms when they're not common C++)
 
@DeadMG probably not the only one. but one of many im sure.
 
1:37 PM
@tina hash-table or binary tree? or what is it for?
 
@tina std::map is usually my first choice when I need some sort of lookup table.
 
yeah- looking up what, based on what?
based on what key, filepath?
 
sbi
@DeadMG I dunno whether you're the only one, but I like it.
I learned to like the Pimpl idiom when I was in a project where compilation from scratch took an hour or longer. Pimpl hides a class' innards, and thus reduces the number of headers included in other headers. That can drastically reduce compilation times.
 
@tina it helps when you explain what you're trying to achieve.
 
@sbi: Why not use run-time inheritance instead?
same job, less suck
 
1:39 PM
@DeadMG I don't see how run-time inheritance is an alternative to pImpl...?
 
@tina ko? I hope you're not gone KO! LOL
 
well, you have an Impl on the heap anyway
so you may as well alloc a polymorphic object on the heap
 
@tina we're waiting
 
@DeadMG So the question is about composition vs inheritance?
 
@sbi That was a comment on East coast arriving at work West coast sleeping and Europeans actually working...
 
1:41 PM
@tina out of curiousity what is your native language?
 
@StackedCrooked: PIMPL is not composition
 
cpx
@sbi Ah, yes I see now.
 
@DeadMG I know. But since you compare it to inheritance I'm getting somewhat confused..
 
well
instead of having a class whose internals are managed by PIMPL
just make it into an interface, and have a create() function to return an object that derives
far superior option
 
@DeadMG Inheritance doesn't allow you to hide internals like pimpl does.
 
1:43 PM
@DeadMG composition isnt PIMPL, but PIMPL is surely composition. of a pointer to the pimpl object.
 
of course it does
 
@ChrisBecke There is a sequence point after the evaluation (unordered) of all arguments and the function execution. That means that i++ and all its side effects must take place before the value is read inside f --the important piece is that because the argument is a reference, the actual value is not read at an unknown order with respect to the i++, but it is guaranteed to be read after.
 
if I derive from an interface, then the details of the deriving object are unknown to the user of the interface
 
@DeadMG Pimpl allows you to hide the usage of certain header files.
 
so does inheritance
 
1:44 PM
Now, it is true that I made a mistake, and it will print 1, 0 (I was thinking in ++i, rather than i++, with i++, the second argument will be the value before the increment)
 
@DavidRodríguezdribeas ah. clever. not that id ever use that knowledge :P
 
the derived class can be both declared and defined in a totally different translation unit
 
@DeadMG it has to be defined in the current translation unit for the child class to derive from it.
 
I have it fresh, as I read it yesterday... in the article on how BOOST_FOREACH is implemented, the author uses that trick
 
Bluntly, the compiler cannot instantiate a derived class without knowing how big the ancestor class(es) are
 
1:47 PM
@tina sounds like you have to have a pointer to the first pixel and then XOR the color values of each pixel, move on to the next pixel
so you need start by defining a pixel
 
I don't know, I don't see how interfaces can completely replace p-impl. In the worst case scenario I'd have to write an interface for every class, and that's just cumbersome.
 
@tina seems like I misunderstood what you were saying
 
contain(EVAL(container,is_rvalue), is_rvalue )
Where EVAL is a macro that... well, consider that a function that will return a pointer to the container, and in the process modify the second argument with true/false depending on whether `container` is an l/r-value. The result of that second argument is passed to the `contain` function as second argument... without the `const&` trick, the second argument could be copied *before* it is set
 
@tina honestly you should post a question on SO proper, with ALL the data in it
 
@tina You want to draw an HCURSOR onto an HBITMAP?
so. 1. create a bitmap with CreateCompatibleBitmap or CreateDIBitmap
2. load the cursor and icon as an cursor and icon.
3. call GetIconInfo (and GetCursorInfo) that will fill in a struct containing the HBITMAP representing each of them.
4. BitBlt the HBITMAPS obtained in step 3, onto the HBITMAP created in step 1.
this does look like a Q for SO proper.
 
Als
1:55 PM
What would be a better book to start learning more about Standard template library? The C++ Standard Library by N Josuttis or Effective STL by Scott Meyers?
 
Q=Question. sorry
 
6 mins ago, by Tony
@tina honestly you should post a question on SO proper, with ALL the data in it
 
It'd probably be easier to use DrawIconEx instead of extracting icon/cursor bitmaps.
 
@tina link seems not to work
 
2:32 PM
Ok, so you are actually trying to generate an HCURSOR with an image you define yourself?
 
Er, that's Xlib, not WinAPI.
 
@tina you need to specify WHICH API you're using? Xlib is NOT equal to WinAPI!
 
1. thats xlib, not windows. but perhaps you are trying to port an x app to windows?
2. why not just create a cursor resource for each cursor
then ljust load them using LoadCursor(hXlibDll, xlibresid);
HFONT win_XCreateFontCursor(unsigned int shape){
  static HMODULE hXCursorDll = LoadLibrary(TEXT("xcursors.dll"));
  return LoadCursor(hXCursorDll,shape+1);
}
HFONT win_XCreateFontCursor(unsigned int shape){
  static HMODULE hXCursorDll = LoadLibrary(TEXT("xcursors.dll"));
  return LoadCursor(hXCursorDll,MAKEINTRESOURCE(shape+1));
}
This function assumes that you have used the resource editor to create a resource dll called xcursors.dll, that contains cursor resources for each x resource, with an id that maps to that header+1
 
sbi
How C++ is like teenage sex:
1. It is on everyone's mind all the time.
2. Everyone talks about it all the time.
3. Everyone thinks everyone else is doing it.
4. Almost no one is really doing it.
5. The few who are doing it are: A. Doing it poorly. B. Sure it will be better next time. C. Not practicing it safely.
3
 
2:50 PM
version 2 had the MAKEINTRESOURCE(shape+1)
that converts an integer resource it into a string resource id
 
What do singles and married men have in common?
They both think that the other is getting all the sex.
 
return LoadCursor(hXCursorDll,MAKEINTRESOURCE(shape+1)); // use this line
 
@tina sorry if I offended you, it was not my intention, it was just a joke related to the previous (linked) comment
 
sbi
@DavidRodríguezdribeas And what does this have to do with C++? :)
@tina It's a chat room, so give us some leeway. :)
 
@tina Why? Sure, off-topic, but c'mon.
 
2:56 PM
@sbi she's getting pretty serious on us, getting worried :)
 
Oh, my... what have I done... now against the wall... "I won't mention the s word" 100 times
 
sbi
There was a time here, when we jumped on every C++-related discussion that tried to raise its ugly head. :)
@DavidRodríguezdribeas There's Europeans here, so: sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex
@tina So?
 
@tina so does that make sex an indiscussible subject?
 
@sbi: Wow, did you copy and paste the whole lot?
 
It's also the Internet, it's pretty much made of it.
 
2:58 PM
lol
difficult to suggest that this chat room is, in fact, not made of Internet
 
@PiotrLegnica what would internet be without it? prob not worth much
 
sbi
@DeadMG Of course, I typed it. Sex needs to be painful. Oh, wait...
 
lol
 
@DeadMG the internet isn't just made of sex
 
sbi
@tina Yep, happy. Thanks.
 
2:58 PM
There's also quite a lot of hitler, and kittens
 
@sbi joyful you meant... lol
 
lol
 
@jalf lolcatz
 
honestly
 
sbi
@Tony Without sex, the Internet would be a much cleaner place.
 
2:59 PM
there's something disproportionately funny about Hitler
I don't know what it is
 
@sbi yea but it keeps us on our toes... :)
 
but so many of those Hitler parodies on YouTube just crack me up
 
sbi
@Tony Ah, that was the word. Escaped me, momentarily...
 
@sbi it'd also be able to fit into the ipv4 address space pretty much forever ;)
 

« first day (174 days earlier)      last day (4764 days later) »