« first day (646 days earlier)      last day (4528 days later) » 

20:00
@JimNorton A candidate for what?
I figured it was a good time to start refining C over what I know from C++ too.
@FredOverflow For me to understand move() swap() which was used in the code you helped me with.
@FredOverflow It makes some sense because no ref-qualifiers means 'either', so you'd easily end up with ambiguous overloads anyway -- in fact that's the case here since A and A&& are ambiguous for rvalues. (So yes, that does mean it is possible to construct non-ambiguous example via other parameters.)
@JimNorton If you're interested in move semantics and unique_ptr, may I recommend another one of my answers? :)
9
A: Can someone please explain move semantics to me?

FredOverflowMy first answer was an extremely simplified introduction to move semantics, and many details were left out on purpose to keep it simple. However, there is a lot more to move semantics, and I thought it was time for a second answer to fill the gaps. The first answer is already quite old, and it di...

sorry for the shameless plug
@JimNorton No big deal. If I weren't up for it I wouldn't have done it. I also ask for help here too.
20:02
@LucDanton Ok well, I just want to be sure you realize how much I appreciate the help.. you guys spent A LOT of time helping me out today.
@Jim You pay the community back by providing great answers yourself. That's how stack overflow works.
@FredOverflow Roger
@FredOverflow Ok I will read that one over also.
@JimNorton You might need a little more time for that one ;)
Is that the nine page essay one?
Yes, yes it is
@FredOverflow Lol.... ummm yeah
It's a small thesis
20:07
So, I'm alone at a festival and I'm checking out the clounge..
Guess I'm beyond help.
@StackedCrooked No fun rides you can enjoy?
@StackedCrooked you are one of us now
fun rides? it's mostly bands and bars here..
fun rides? it's mostly bands and bars here..
Tony you know what I'm talking about :D
heh, I got a good answer badge for a deleted answer.
20:10
@JimNorton Doesn't a scientific thesis need to include lots of references in order to count as a thesis? Oh wait, I have lots of rvalue references in there!
@FredOverflow Thanks!
for what?
@FredOverflow boo
For everything!
You're welcome I guess?
20:13
@JimNorton It's been a good day in the lounge....you got lots of help, and we got to discuss chipmunk porn. And, for completeness, the Cat pooped on the floor. Bad kitty!
this v
> we got to discuss chipmunk porn
what?
@keith.layne Yes very good day! :-)
how many fucking series of Lost is there?
20:18
6
1-3 was okay, rest sucked
I played the DS |:
I sure was the alternativest of them
So is there a way to make this more readable? Can some of that actually go into the body of the function?

// Constructor
CairoImage::CairoImage( const std::string& imageFile )
   : m_surface(cairo_image_surface_create_from_png(imageFile.c_str()), cairo_surface_destroy)
   , m_cr(cairo_create( m_surface.get() ))
   , m_size(cairo_image_surface_get_width( m_surface.get() )
       ,cairo_image_surface_get_height ( m_surface.get() ))
{
    std::cout << "Image Created" << std::endl;
}
better not in the constructor body
Perhaps I should have brought a book. Then I'd look like a hipster.
20:20
Maybe it is readable, I just don't understand it...
@Jim
hmmm
but you understand what it's doing, right?
ops
@Jim it is readable, but obviously looks cluttered
@LucDanton I love how you (and the robot) have nack of bringing all those tangly webs down to new simple guidelines. That is a real talent. I'm learning again
20:21
@keith.layne Yes, it's setting the member variables..
I think your best bet would be to just indent it in a more spaced way
yes, if you put it in the body then they are initialized and then assigned (correct me if I'm wrong guys)
But I don't understand how that can be done where it's being done. What should I google to understand that syntax?
member initialization list
I'm going to sleep.
20:22
@R.MartinhoFernandes Have a good sleep.
@JimNorton it shouldn't be in the constructor. You could move it there, but it shouldn't be there.
@R.MartinhoFernandes shutdown -H now
initialization list, not initializer (it's confusing, I know)
@MooingDuck Ok.
@R.MartinhoFernandes Good night robot
20:23
my bad
thanks for the correction
2 hours ago, by Mooing Duck
@Ell "initializer list" (not to be confused with std::initializer_list)
@StackedCrooked I don't know what you're talking about :)
Xeo
Xeo
@StackedCrooked member-initializer-list IIRC
@n2liquid Ah excellent thank you.
20:24
@sehe To give credit where credit is due a lot of 'my' rule of thumbs/guidelines/whatnots are repeated from others. And in this particular case I'm not an advocate of copy-and-swap (which I first learned about from Sutter IIRC). One day I might get around to writing that "When not to use std::function" column since nobody seems to be advocating that though.
Well, when you and Herb collaborate on a book, I'll buy it.
@Xeo that's what we call it to distinguish it, but the standard doesn't use the word "member" there :(
@JimNorton I think the most unambiguous name would be Member Initialization List if you're curious
Xeo
Xeo
@MooingDuck really?
@Xeo only result for "member init" after the classes header in teh standard is in the "implementation limits"
20:25
@LucDanton Did you team up with the robot on his blog thing (Flaming Dangerzone)? That would be awesome place if you don't have one. Or is my RSS reader missing your feed?
hey @Xeo, you don't use Twitter much, do you?
@keith.layne We don't need Herb on it ;)
Xeo
Xeo
nope
Mostly reading
19
Q: What is this weird colon-member syntax in the constructor?

nilsRecently I've seen an example like the following: #include <iostream> class Foo { public: int bar; Foo(int num): bar(num) {}; }; int main(void) { std::cout << Foo(42).bar << std::endl; return 0; } What does this strange : bar(num) mean? It somehow seems to initializ...

@Xeo the other two matches are about "aggregate member initialization"
20:26
@sehe :)
@sehe Since I'm quite slow on posting there, I don't mind having someone else contribute.
Luc is more robot-like imo :)
Should you always use explicit ctors?
@keith.layne Herb is an important 'leader' in the field, but he doesn't quite have the nack of explaining quite like some of our residents here
@ManofOneWay Yes. No.
20:27
He's a machine when it comes to churning templates.
everyone contribute!!! you just got bookmarked, bitches.
@Xeo I mentioned you but you didn't answer ): I just wanted to know what's your level of interest in J-RPG development
@Xeo Oh! standard calls it "mem-initializer-list"
@keith.layne Wut?
Xeo
Xeo
@MooingDuck knew it was something like that
20:28
@sehe Honestly though reducing at least common cases to some guidelines seems to be a very sensible way to approach C++. That's what a lot of the literature does, doesn't it? Like GotW and so on. The bruteforce approach of learning all the minutiae seems too daunting.
@StackedCrooked Well, the main thing is: avoiding template churn. The guys with the nack can write the same stuff I do with less than half the boilerplate. And it will work :)
@R.MartinhoFernandes If you wish please elaborate :)
your flaming poop or whatever blog. I'll write an article called "How to be awesome during the robot apocalypse".
@sehe I haven't written anything anywhere, other that my SO answers I suppose.
@ManofOneWay Explicit ctors are good because they avoid implicit conversions. Explicit ctors are bad because they prevent return { blah... };.
20:28
@LucDanton Yup. It seems, my brainpower needs it. I have stamina, but I loose track of details too soon for TMP. Or so it appears :)
Xeo
Xeo
@n2liquid I'm interested in J-RPG, that much is sure :)
@R.MartinhoFernandes I find that more a fault of braced-init-lists. :/
@LucDanton Did you spot the robot's implicit invite just now?
@MooingDuck "...initializer-list", really? :( How can they be so stupid and call the new { ... } stuff std::initializer_list then?!?
@sehe Yes :p
Good :)
20:30
@FredOverflow Well obviously they removed the 'mem' for the latter.
@Xeo that's great to know; do you have some spare time to work on an open-source engine dedicated to that? or interest in that, at least
Not confusing at all!
Xeo
Xeo
@n2liquid Depends on the codebase, I guess? :P
@Xeo it's blank right now; could you ask for anything better? :D seriously, though, when I've got something interesting to show I'll let you know
I'm just asking since you have such a C++ fluency and J-RPG interests ;) I don't know a lot of people like that
"I'm going to sleep", I said. Yeah, right. I'm going to design my text class, that's what I'm going to do.
20:35
by the way, is this kind of talk appropriate here, or is this chatroom extrafocused on learning like StackOverflow QA?
Xeo
Xeo
What style, though? Or rather, what specifically is the engine for? The combat system, the UI, the world, characters, ... ?
@n2liquid This is The Loungeâ„¢, no strict rules here as long as you follow the newbie hints
(now called code of conduct and linked on the right)
@n2liquid We're quite lenient on topics of conversation here.
@Xeo absolutely everything
that's great; good to break the ice from QA, I guess
Xeo
Xeo
Except on Haskell, as we've seen yesterday
lol
flame war?
Xeo
Xeo
20:36
@n2liquid So... what kind of J-RPG? Old school style ala RPG Maker or... ?
@Xeo Well, it's the important rule: don't be annoying.
@Xeo no, I target something PS2-level, like Tales of The Abyss and up
actually GameCube level, since it'll obviously use shaders
Xeo
Xeo
Do you know Chantelise or Recettear?
@Xeo 'course :D
what about them?
Xeo
Xeo
So, Tales of the Abyss looks kinda like Chantelise style, if I got that right?
20:39
@Xeo o-o seriously? they're very different for me
very
Xeo
Xeo
Hm, maybe it only looks like that from some of the screens
never played that game
Chantelise or Abyss?
Xeo
Xeo
abyss
have you played any game from the Tales of series?
Xeo
Xeo
So you're going for round-based combat, or do you plan to let the user of the engine decide, aka support more than that?
@n2liquid Sadly, no, never had much money for consoles. :(
20:42
good afternoon ladies and gentleman
I left france behind, now from Amstedam I shall speak
@Xeo I see; so, yeah, the user of the engine would decide upon the battle system, but I want to start with a custom battle system for a project
@FredOverflow apperently the member thing is called "mem-initializer-list"
That's just the syntax name for the non-terminal, right?
"mem-initializer-list" would be a terrible name for a concept.
@FredOverflow it... doesn't have any other name in teh standard. It's actually called that.
Having no name is even more stupid than having a terrible name.
20:45
@FredOverflow it's named after it's non-terminal as far as I see
@MooingDuck Looks like you still have one of those anonymous upvoters..
@Drise do you say that because you just upvoted me?
@MooingDuck No. Just notice things.
what happens if I call std::swap on two custom objects?
what the, one of my questions has a score of 17, and the accepted answer on that question has a score of -1?
@ManofOneWay compiler error probably, unless one has a reference conversion to the other.
20:50
I don't get a compiler error right now
good evening
@ManofOneWay that sounds like a buggy swap most likely. Possible the swap is actually working though.
Just watched "The Machinist". What a strange psycho movie!
@n2liquid ok thanks again
@MooingDuck, Wow, that's harsh
20:51
@MooingDuck ideone.com/C7BK4
It's the swap in B
has anyone here ever had the disgracing experience of using a version control system called Serena Dimensions?
@sehe, it's for you.
@chris OP didn't understand my answer, and trusted the other more because it looked more like code he would write I guess.
@MooingDuck, Yeah, not too many people who ask those sort of questions do understand it, but they should take the time to learn when it gets that many upvotes.
@ManofOneWay Default behaviour is to swap via one copy and two successive assignments in C++03, and one move and two successive move assignments in C++11.
20:54
@chris I commented and described it, but he just didn't get it. (this question btw)
e.g. auto temp = std::move(first); first = std::move(second); second = std::move(temp);.
can I bombard this channel with haskell questions again (no one seems to be active in Haskell)
@Nils It was for sure an interesting movie. I enjoyed it.
@MooingDuck, Yes, I see. I already had it upvoted from before sometime.
@LucDanton I see, then I guess my code should work
:(
Do you get an error or does it fail in runtime?
@ManofOneWay oh wait, Visual Studio? Look at the warnings when you compile
@ManofOneWay the error is in the link
@nightcracker Haskell questions are fine as long as the Lounge is quiet, which is not the case now. Just invite us to the Haskell channel.
@MooingDuck Oh I didn't try it in ideone. I use clang 3.2 here
@FredOverflow: how?
20:57
@ManofOneWay unrelated: B::swap uses std::swap instead of A::swap to swap A objects.
Yeah, it's perfectly fine to come here and say "hey guys, anyone available to meet me in the Haskell room?"
@MooingDuck Oh hey. That was me.
    friend void swap(A &first, A &second) {
            using std::swap;
            swap(first.t_,second.t_); //uses correct swap function
            swap(first.size_, second.size_);
    }
@MooingDuck What doesn't work here is that you're trying to swap A<int> with B<int>.
@Drise no, I think you understood the code, it's just the OP
20:58
@MooingDuck I meant that was my answer. I still took a lot away from yours.
@LucDanton that's exactly what I'm telling Man of One Way, yes.
How come it calls the A::swap by saying using std::swap?
@nightcracker Just paste a link here or something, dunno :)
@MooingDuck Is that really relevant?
@ManofOneWay using std::swap is a fallback in case no specialized swap is available.
20:59
@ManofOneWay using std::swap means if you can't find a swap function, use std::swap as a fallback. But it should find ::A::swap. Technically the using line isn't needed there, I jsut put it there out of habit.

« first day (646 days earlier)      last day (4528 days later) »