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

3:00 PM
@thecoshman You can't pick one over the either since the range of problems they each solve have little overlap.
 
@LucDanton but what would you say is most likely to be a default one to be
 
What would you say is the default between a screwdriver and a hammer?
 
always the hammer
 
Zing
@LucDanton hi, btw. Long time no seen
 
Ell
I would say screwdriver
You could hammer a nail in with the back end of it
but you cant screw in stuff with a hammer
 
3:02 PM
@sehe Hi, getting some things done these days like moving.
 
Oh my. Lounge<C++>: always derailing sensible arguments
 
It's a matter of principle, not of function
 
@LucDanton ah, exactly my point! yes, you do need to know more info, but as a default, I would say I use a hammer more, and thus it would be my go to tool.
 
It is a principle of matter, not function of principle.
 
room topic changed to Lounge<C++>: Always screwing hammering _derailing_ sensible arguments [c++] [c++11] [c++-faq] [fun]
 
3:03 PM
Also, bacon.
 
any way, I ask because of this
@sehe markdown fail, or more lack of :P
 
That is a fail answer.
 
room topic changed to Lounge<C++>: Always <strike>screwing</strike> <strike>hammering</strike> derailing sensible arguments [c++] [c++11] [c++-faq] [fun]
@thecoshman You. Don't. Say.
 
@sehe actually, I did say
 
You. Don't!
 
3:04 PM
Smart pointers save lives. For general purpose programming (most problems) smart pointers are the best way to deal with memory.
 
I have no recollection of smart pointers :)
 
@sehe zero, zero fucks given
 
@thecoshman You should do that more often
 
@sehe Same here, but that's because I do rendering architectures. And you're also a low level extraordinaire, if I remember correctly.
 
@sehe as should you
 
3:06 PM
I'm a lowlife, if that's what you mean.
@thecoshman no you! :)
 
@sehe ¬_¬ this is only going to end with a flipped table
 
@thecoshman Not if you give sufficiently few fucks
 
I have a glass table, no flipping. :(
 
@DomagojPandža What? A lead table. That would resist flipping more
 
@DomagojPandža (╯°□°)╯︵ ┻━┻ .._ ___ L _ ..
2
 
3:07 PM
I don't see how RVO has anything to do with code being in a different TU
0
Q: g++: How RVO works in case that multiple translation units are involved

SmgFirstly please take a look at the following code, which consists of 2 translation units. --- foo.h --- class Foo { public: Foo(); Foo(const Foo& rhs); void print() const; private: std::string str_; }; Foo getFoo(); --- foo.cpp --- #include <iostream> Foo::Foo() : st...

 
Xeo
I'm in for a new sport: Air table flipping
 
TU is compile time, and RVO is runtime
 
@thecoshman Something like that. :Đ
 
Xeo
@TonyTheLion no
 
Ell
off to mow the lawn guys, ta ta :)
 
3:08 PM
@TonyTheLion Wut
@TonyTheLion Inlining required
 
@Xeo (╯°□°)╯︵
 
Xeo
doing or not doing RVO is decided at compiletime
 
ok
but TU's are not relevant at runtime?
 
@Xeo do RVO or do not RVO, there is no try
 
Xeo
 
3:09 PM
@Ell I read that as "Get off my lawn, guys!"
@Xeo Rather a big one :)
 
Xeo
thinking one thing, writing another
okay, I'm clearly not able to form coherent sentences today
 
Going great there
 
Xeo
I blame my lack of sleep
 
Does a raise at work count as RVO?
 
Xeo
(as always)
 
3:12 PM
You can have runtime RVO by selfmodifying code. Or exceptions. Or longjmp. But you'll have to code it yourself. And it's going to cause pain (<-- jokinh)
 
My first impression of WxWidgets is that it's built on old C++ techniques, and the documentation sucks.
 
WxWidgets suck(s) dick.
 
@FredOverflow kind of like all the gui frameworks?
 
@DomagojPandža I'll allow it
 
Xeo
T do_foo(T* opt_rvo = 0){
  if(opt_rvo){
    *opt_rvo = X;
    throw abuse_exceptions_as_control_structure_for_fake_RVO();
  }
  return X;
}
@sehe kinda like that? :P
 
3:15 PM
Raw pointers everywhere? Macros to build "event tables"? A strange function called _ that seems to handle unicode? Yet another string class? Copy on write? Seriously, WTF?
 
Xeo
Hm, wait, you can improve on that.
@FredOverflow It's old.
 
The next C++ standard needs to include a modern GUI framework.
 
Xeo
@FredOverflow "standard GUI"
right
 
@FredOverflow Write a GUI programming yourself. Here, take my pointer, it is dangerous to go alone.
 
Xeo
@FredOverflow so not happening
 
3:17 PM
At least give us a standard file system then :)
 
Since we are making requests, Do What I Mean should be a part of std::
 
Xeo
#include <filesystem>
 
HaKsell and GUI. Impossibru. Monads to the rescue.
 
I'm sure C++ would become more popular if it was designed for what people think programmers can do.
 
Seriously, write a good GUI framework in Haskell and make C++ bindings. It's our only hope.
 
3:20 PM
HackByName ("John Smith");
 
@chris masturbation? How could it be designed for that?
Oh wait, that's what programmers actually do.
 
Xeo
Idiomasturbatic code.
 
while (video.rating < 0.75) video = GetNextVideoFromCategory (CATEGORY_PORN); video.play();
 
you should have gone with at least .8
 
brb marketing it
 
3:24 PM
.95 sometimes sucks
People are weird fucks.
 
@Xeo I was joking. But yeah, kind of like that. Obviously, it would require passing in (sneakily?) a pointer to the return value, which, to be 'true' to RVO would need to be stack allocated. Like I said: horrible horrible. But you could decide to 'RVO' from, say within the 60th level of recursion :) LOL
 
I wasted half an hour on this. I want rep.
1
A: char array - dealing with memory

R. Martinho Fernandes(Disclaimer: this answer only covers C++. It is not recommended to ask for both C and C++, as both languages are quite different) Prologue char *k ; This declares a pointer to a character. "ddddd" This expression has type char const[6], that is, an array of six constant characters. Express...

 
Xeo
@sehe Yeah, actual code would have to look a bit different
 
Now I'll do some work.
 
Xeo
I only wish you didn't have to abuse exceptions
 
3:26 PM
@Xeo longjmp
 
@R.MartinhoFernandes, I was going to write something like that, then gave up.
 
@R.MartinhoFernandes There, take it!
 
@R.MartinhoFernandes How's that for real-time vote updates? :P
 
@Xeo Could even go with direct stack manipulation: a bit of inline assembly could just pop a different return address from the stack. Of course, that bypasses all RAII and exception safety mechanics :)
 
@R.MartinhoFernandes But you wrote the convenient fiction that *k has a reference type D:
 
3:27 PM
@R.MartinhoFernandes hmm, not enough jquery...
 
@sehe NO. :Đ
 
AND JELLY
@DomagojPandža He asked for it :)
 
BACON!
 
KEVIN
 
:-)
 
3:29 PM
rect():w(0), h(2) {}
rect& operator - () { w += 0.5f; return *this; }
rect& operator - (rect&) { w += 0.5f; return *this; }
rect& operator -- (int a) { w += a; return *this; }
rect& operator -- () { w += 1; return *this; }
rect& operator ! () { h += 0.5f; return *this; }

definitely C...
 
 
@LucDanton It think it's a worthy lie-to-children.
 
mmmmmmmmmm biscuits
 
@Drise Onebox fail (referrer/hotlinking)
 
@JimNorton I love it so much :)
 
3:30 PM
@R.MartinhoFernandes I noticed you don't mention the semantics of k = d but I figure if anyone is wondering they'll leave a comment.
 
@R.MartinhoFernandes The last answer code sample, format that shit! Press them spacebars.
 
It's great for every meal!
 
@TonyTheLion does that mean "cookies" in jolly ol' england?
 
@keith.layne yea
 
@DomagojPandža Feel free to do it. I really need to get working now.
 
3:31 PM
Also lol @ "Chapter 1".
 
@chris WTF with rect& operator-(rect&)- it doesn't even check the param?
 
@TonyTheLion do they call him "biscuit monster" there?
 
@sehe What?
 
donno, I think that biscuit and cookie is something different, but I may be wrong
ask @DeadMG, he eats cookies all the time :P
 
@DeadMG, Sorry, it's meant for drawing ASCII art.
That story again.
 
3:32 PM
crumpet?
 
@TonyTheLion I can't.
 
@Drise Image not found
 
@DeadMG It's magic.
 
It finally actually rained quite a bit here in the desert.
 
3:33 PM
I was plonked long ago, within my first 5 minutes ever in here.
@JimNorton where are you?
 
oh
 
@DeadMG It's an old joke with 'literal' code.
 
@keith.layne Las Vegas NV, USA Mojave Desert.
 
oh the analog literals stuff
 
Xeo
3:34 PM
int get_answer(void* opt_rvo = 0, jmp_buf* opt_jmp = 0){
  if(opt_rvo && opt_jmp){
    ::new (opt_rvo) int(42);
    longjmp(*opt_jmp, 1);
  }
  return 42;
}

// in code ...
jmp_buf env;
char ret_buf[sizeof(int)];
int* ret = (int*)(ret_buf);
bool check = setjmp(env);
if(!check)
  ret = new (ret_buf) int(foo(ret_buf, &env));
// ...
okay, enough horribleness
 
@sehe It's definitely there.
 
cookies are soft, sweet, and chewy
biscuits are hard and crunchy
 
@Drise Observer Paradox. It's only there for you, likely. Your browser hath cached it?
 
then I'm having cookies :)
 
@JimNorton fun. I'm done with deserts forever I hope.
 
3:34 PM
if you leave cookies for long enough, they'll go hard and crunchy too :p
 
Cookies decay to biscuits.
 
Chewy Chips-Ahoy FTW
 
What is a crumpet then?
 
And cookies don't expire, they decay...
 
3:35 PM
@R.MartinhoFernandes kinda like arrays decay into pointers :P
 
Damn it, R!
 
@sehe I figured, but I even follow the link and it's there.
 
Beat me :(
 
@keith.layne Yeah, the summers are terrible.
 
fuck hot weather, I hate with a passion
 
3:35 PM
@Drise Observer Paradox. Cannot be verified from the observer standpoint, can it?
 
I wanna live on the North Pole or something
 
@TonyTheLion Fuck hot chicks.
 
@sehe Just for you though:
 
@TonyTheLion you have an elf fetish? Ew.
 
3:36 PM
elf?
 
12 mins ago, by Domagoj Pandža
People are weird fucks.
 
What. The. FUCK???
 
North pole
 
no traffic in the LOUNGE(C); for three days now. :-)
 
Santa -> elves.
 
3:36 PM
 
@sehe Hey! What was that for?
 
there's elves on the North Pole??
TIL
 
sehe's manliness felt threatened :Đ
 
Duh, who do you think makes all the presents?
 
your mum
 
3:37 PM
@DomagojPandža No. The room's NSFW policy was being ignored :)
 
The Chineese
 
@Drise ^
 
@JimNorton Post something regularly. You don't want it to be frozen for inactivity (we had to ask a mod to thaw the Haskell room once).
 
Hello? What's up.
 
@Drise Ok wil do
 
3:38 PM
@TonyTheLion She can't do it all by herself.
 
@JimNorton They awso doo teh spelling
 
@sehe You don't really parse jokes? :P
 
@RadekSlupik Clouds are up
 
@JimNorton Erm?
 
@DomagojPandža his jokes parser is not working ATM
 
3:38 PM
I do. It is irrelevant though.
Also, you parse smileys?
 
@Tony sounds wet.
 
@Drise Yeah sorry, wrong person.. :-)
 
@sehe I don't see how Kevin Bacon could be considered NSFW.
 
@RadekSlupik wut?
I don't have a vagina :P
 
@Drise That's kevin bacon? Six degrees, alright
 
3:39 PM
@Drise It's a photo of an undressed person.
 
@TonyTheLion That can be fixed with surgery.
 
@TonyTheLion Yet
 
@Tony vagina jokes aren't funny. Period.
 
@JimNorton no thanks
@RadekSlupik lol
 
@TonyTheLion Heh
 
3:40 PM
@RadekSlupik Lame repeats are becoming the next hot thing
Lame repeats are becoming the next hot thing
 
Shall I post some simple C++ wrapper class that I wrote? It's kind of my first real C++ code.
 
Xeo
@JimNorton What does it wrap?
 
@JimNorton To where? For what?
 
@JimNorton Showies! We shall bash it to oblivion!
 
@sehe everything on the internet is a repost, you should know that by know
 
3:41 PM
I'd rather see a C++ rapper class :)
 
@sehe periods occur periodly, actually, so you are right.
 
@keith.layne 2pac
 
@sehe I prefer to include a smiley to every message online to convey emotion. Otherwise, it feels like I'm attacking someone. Especially when I disagree with something. :Đ
 
Xeo
class rapper{ void get_shot(); };
 
@Xeo Cairo 2D vector image library "image"
 
3:41 PM
MJ a rapper? No way. Maybe Parappa.
 
@Xeo y no Blood as return?
 
Ok hold on... I'll get some links... It's nothing special.. but tear it apart...
 
@Xeo 2Pac
 
@keith.layne I thought you said raper.
 
@DomagojPandža class rapper{ void get_shot() { new blood(); /* leaks */ } };
12
 
3:42 PM
Sixpack.
 
@RadekSlupik periodly?
 
oh wow
 
@R.MartinhoFernandes Ha!
 
Or was it that rapist wit?
 
periods are bloody, just like shootings
 
3:43 PM
more so.
 
Xeo
@R.MartinhoFernandes genius.
 
@TonyTheLion I hate periods, puts them out of commission for 7 days and 5 days prior have a chance of a shooting occurring.
 
@R.MartinhoFernandes Is the blood really new though?
 
http://ideone.com/WL8Op ( CPP )
http://ideone.com/Yfujz (HPP)
Like I said, nothing special
 
3:44 PM
CamelCase?
 
@R.MartinhoFernandes Rule of 4.5!
 
Xeo
@SamDeHaan class rapper{ std::unique_ptr<Blood> _blood; void get_shot(){ _blood.release(); } };
 
gint CairoImage::GetWidth() <---- Oh god why?
C++ != Java
 
@TonyTheLion What's wrong with it?
 
3:46 PM
getters/setters
meh
 
@TonyTheLion There are no private fields backing them up.
 
gint? Is that like the douchebag version of int?
 
It's as bad a getter as std::vector<T>::size() is.
 
Getters and setters rock.
 
#define HIV_POSITIVE new
return HIV_POSITIVE blood();
 
3:46 PM
then just call it Width(), loose the get
so ugly
 
@EtiennedeMartel It's a GTK defined int, for portability I assume
 
@TonyTheLion I don't like the Get prefix either, but that's just cosmetics.
 
@TonyTheLion I could lose the Get I suppose
 
@Tony write wrapper problem solved.
 
@R.MartinhoFernandes well, I know
 
3:47 PM
excellent. My company's code makes a SOAP call to the master server to convert GMT time to the user's local timezone.
 
What's wrong with my Constructor / Deconstructor? Is something left dangling?
 
@JimNorton You need to consider copies too.
 
deconstructor, lol
 
@TonyTheLion, Curious, what would you replace SetWidth() with?
 
destructor, you mean
 
3:48 PM
destructor
 
Copies either make you, or break you.
 
(The post about the rule of three I linked above explains it)
 
@chris meh, nothing, find another level of abstraction that makes sense
 
@MooingDuck That's incredibly badass.
 
@R.MartinhoFernandes Ok I will read through it... thanks :-)
 
3:49 PM
You need to consider copies even if all you do is just forbid them. But what you shouldn't do is ignore them, as they will easily stab you in the back.
 
@TonyTheLion, Makes sense.
 
@R.MartinhoFernandes what a bunch of backstabbing sons of bitches
 
Here's how I instantiate that object: CairoImage Image( "images/blankwheel.png" );
Is a "copy" an issue?
 
copy constructor?
 
Here, it is not. But a copy constructor is advised to exist.
 
3:50 PM
if you say CairoImage image2(image) what will happen?
 
If only to delete the fucker.
 
@JimNorton, Imagine if you put it in a vector or something, which is reasonable. Copies ahoy!
 
a copy constructor is the normal way of things in C++
 
@JimNorton Nah, the issue is something like this: CairoImage image("blah"); void f(CairoImage i); f(image);.
When you pass it by value, it gets copied. Now you have two instances, and they'll both be destroyed some time. But they'll destroy the same underlying object.
 
that's what I meant.
 
3:51 PM
listen to the robot
 
Robots are good at C++.
 
An implicit cctor makes a shallow copy, effectively referencing the same object. One runs out of scope, the other one gets broken.
 
181
Q: What is The Rule of Three?

FredOverflowWhat does copying an object mean? What are the copy constructor and the copy assignment operator? When do I need to declare them myself? How can I prevent my objects from being copied?

 
Bang, dangling pointorz.
 
I'm confused.. Isn't each call to the constructor going result in a separate instance of the object?
 
3:52 PM
C++ was clearly not made for humans.
 
@JimNorton By default, the members are copied, but in the case of pointers, that's not what you want. That's why C++ allows you to define the copy constructor and copy assignment operator yourself.
 
Xeo
Fuck rule of three, use proper building blocks
Aka teach him about smart pointers
 
@JimNorton There are multiple overloads of the constructor, when you don't define it, data is copied implicitly - by value. In the case of a pointer, that means only the address is copied, not the memory pointed at that address.
 
Fuck rule of three, use proper languages
 
@JimNorton what about SetSurface/Context? you create new ones in constructor, but you replace without cleaning up, I think.
 
3:53 PM
@RadekSlupik fuck proper languages, go do build houses or something
 
> Most of the time, you do not need to manage a resource yourself, because an existing class such as std::string already does it for you. [...] As long as you stay away from raw pointer members, the rule of three is unlikely to concern your own code.
 
@JimNorton it results in a separate instance of CairoImage, but if CairoImage has a pointer member, then the default copy constructor will have both separate instances point to the same data.
 
@MooingDuck Oh, ok so what is the fix for that?
 
pointers: the cunning way in which C++ messes with you
 
Xeo
The question linked above, or proper building blocks
 
3:54 PM
@JimNorton Have your read the rule of three question yet?
 
@FredOverflow Ok I will go ahead and read that now and come back.
 
@JimNorton writing a real copy constructor and assignment operator
 
If it doesn't make sense to copy a CairoImage, I suggest replaceing the raw pointer member with a unique_ptr member.
 
does C# have anything remotely resembling copy ctors?
 
@FredOverflow or a value_ptr, so then you can make copies
 
3:56 PM
deep copy is also necessary in C#, at times
 
@TonyTheLion I don't think it's differentiated from any other type of constructor, which I don't see as a problem.
 
Basically, when you comprehend pointers, you comprehend the rule of three, automatically.
 
Comprehending pointers is managing to shield your ass before they attempt to rape it.
 
@JimNorton You use GTK? Nice! I'm quite into VTK myself.
 
3:57 PM
@MooingDuck TR2 will probably have something like value_ptr.
 
@FredOverflow Well I just want separate objects and the pointers to point to different allocated memory ( Cairo structures ) I don't want them shared amongst multiple CairoImages.
@Drise Yes, I've been learning GTK for a few months now.
 
Forbid copying then.
 
@JimNorton value_ptr or unique_ptr, or delete the copy/assignment operators
 
@JimNorton what's gtkmm like these days?
 
If this question was tagged C or C++, it would've been downvoted into oblivion...
 
3:58 PM
@ecatmur I don't know, actually haven't looked into it..
 
0
Q: Change sign using bitwise operators

AhamedHow to change the sign of int using bitwise operators? Obviously we can use x*=-1 or x/=-1. Is there any fastest way of doing this?

 
Before I came to the lounge today, I had been actively working. On my second display, no change since an hour ago. Damn you, guys. Damn you!
3
 
@Mysticial, You're right.
 
@DomagojPandža That's why you get even more monitors. :)
 
@Mysticial what? change the sign using bitwise operators??? what about multiplying by -1
 
3:59 PM
@Mysticial The third one is my level 52 goblin.
 
So I have two options. 1) Forbid copying 2) Use unique_pointer ? Correct?
 
1 == 2 I think
 

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