« first day (902 days earlier)      last day (4050 days later) » 

4:00 PM
@R.MartinhoFernandes I couldn't quite remember. I knew that bosons is the other group.
 
I never really understood modads
 
Ell
@Insilico s/d the/d an
 
@kbok What's a modad?
 
Ok, I agree I was completely wrong about using smart pointers vs pointers. I would like everyone in this chat room to line up and proceed to kick me in my balls one by one.
 
The fact that I have half-read a dozen of "monad from an alternate perspective" blog articles doesn't help
 
4:00 PM
@Grapes I'll give you a really slow ballkicking over the next few days.
 
@Ell Anyway, don't bother with whether you understand them or not. Most people do, subconsciously.
 
@FredOverflow People halfway between mom and dad
 
Ell
I don't bother with them anyways, I'm allergic to haskell
 
@R.MartinhoFernandes Yeah, just like most people already have a sixpack under that layer of fat.
 
@FredOverflow Which they do, it's just small.
 
4:01 PM
:)
 
@DeadMG And invisible. For some reasons, people seem to strive for visible sixpacks.
 
@ScottW Beep boop.
 
@Ell That's irrelevant. The bastards are everywhere.
"understanding monads" merely means "being able to actually see them when you use them".
 
Ell
Are they? o.O This just shows my lack of experience
I don't even know what a monad is xD
I'm gonna take a guess
a function which takes a "universe" parameter so it still satisfies the "pure" condition
I really have no idea :L
 
Xeo
4:03 PM
Ever used C#? nullable_obj.?method() , the .? is monadic bind for Nullable<T> - kinda, anyways.
 
@Ell A monad is a construction originally made to deal with I/O in purely functional programs.
 
@Xeo C# has .? I never knew that!
 
@Ell That's why most people have trouble understading it. Because it is a generalisation of many existing common structures, the general idea itself is very abstract.
@FredOverflow No.
 
Xeo
Wasn't it C#?
 
std::unique_ptr<DisplayObject>(new DisplayObject);
 
Xeo
4:04 PM
Or was it ?. ... ?
 
any cleaner way to write that
 
Like because I/O is a very "stateful" sort of thing, writing purely functional programs dealing with I/O is very awkward.
 
@Ell And that's merely one instance of those structures. A monad generalises that together with lists, errors, optional values, functions, I could go on.
 
@Grapes Google for make_unique.
 
61
Q: make_unique and perfect forwarding

FredOverflowWhy is there no std::make_unique function template in the standard C++11 library? I find std::unique_ptr<SomeUserDefinedType> p(new SomeUserDefinedType(1, 2, 3)); a bit verbose. Wouldn't the following be much nicer? auto p = std::make_unique<SomeUserDefinedType>(1, 2, 3); This hides the new...

 
4:05 PM
@EtiennedeMartel thanks,was wondering if there was a make_unique
 
So very, very roughly a (type of) monad represent "the world" and doing I/O involves basically making a new "world" with the new data
 
@Grapes They forgot to add one.
 
Does VS 2012 support variadic templates?
 
@FredOverflow Not yet, I don't think
 
Xeo
no
 
4:06 PM
@Insilico That's one particular state monad :P
 
@R.MartinhoFernandes Yeah, just trying to give a particular example. :-P
 
Understanding the specific instances isn't difficult. Who doesn't get lists?
(Ok, I'll make an exception on that rule for continuations)
 
@EtiennedeMartel that doesn't work in VS2012. I am assuming it's because template args are not supported
 
@EtiennedeMartel hahaha
 
4:08 PM
@Grapes Right, VS 2012 does not support variadic templates.
 
@Grapes Variadic templates are missing. Yeah.
 
thanks
 
You can find VS-compatible implementations around though, I think.
 
@FredOverflow The CTP supposedly does, but they're probably bugged like everything else.
 
In the end you can always just make some overloads.
I think that's what the puppy did.
 
4:09 PM
4
Q: Is there a way to write make_unique() in VS2012?

KlaimHerb Sutter propose a simple implementation of make_unique() there: http://herbsutter.com/gotw/_102/ Here it is: template<typename T, typename ...Args> std::unique_ptr<T> make_unique( Args&& ...args ) { return std::unique_ptr<T>( new T( std::forward<Args>(args)... ) ); } My problem is tha...

 
On line 44, you have std::forward<A3>(a3) twice in a row :) — FredOverflow 11 secs ago
 
Anyway, monads are not metaphors: not space suits, not assembly lines, not burritos. Judging from most tutorials out there, one would believe monads are a generalisation of metaphors.
 
can you guys stop being so helpful
I am learning too much here
 
I thought Monads were conveyor belts?
 
4:11 PM
@FredOverflow boooooo code generation by copy paste.
 
@Grapes Yeah, it's weird. Usually newcomers get flamed to death.
 
@Grapes We're helpful sometimes!
 
"can you guys stop being so helpful" <--- Did someone seriously just say that in the lounge?
 
I guess it's all about your attitude.
 
@Grapes learn overflow
 
4:12 PM
:)
 
@EtiennedeMartel What if I told you I already have a few products with millions of users... and I don't even use smart pointers
@EtiennedeMartel yeah... big mistake
 
@Grapes Fun fact: nobody cares.
 
@EtiennedeMartel I know, I am just saying.. what a huge mistake I made
 
@EtiennedeMartel You fell for it
 
@Rapptz I'm all about falling. On you.
 
4:13 PM
@ScottW I don't like burritos. I say Monads are pancakes!
 
@EtiennedeMartel I don't want to be crushed to death. :P
 
I'm not that fat.
 
@Grapes You shouldn't apologize too much, women don't like it.
 
@FredOverflow I am punching myself now, because I was going to use smart pointers but read some stupid article that says that they are evil
 
@Grapes Show us the article.
 
4:14 PM
Yeah, we wanna see it.
 
@FredOverflow I have a female friend that I am constantly telling to stop apologising so much. I suppose she would not have much luck with lesbians, then.
 
@R.MartinhoFernandes What's her orientation?
 
Then she won't have much luck with women, anyway, so who cares? :)
 
4:15 PM
@EtiennedeMartel Not sure where it is now, this was 6 years back
@EtiennedeMartel When I was starting to learn C++
 
Probably hasn't moved
 
Maybe it was a strawman on auto_ptr.
 
user1357851
Is she the same one who told you that you should be less nice?
 
@ScottW what.
@Telkitty Yes.
 
user1357851
lol, you are telling each other that? Am I the only one think there is something between the you two :p
 
4:18 PM
Seems right?:

vector<unique_ptr<DisplayObject>> TestContainer;
unique_ptr<DisplayObject> SampleGraphic(new DisplayObject);
TestContainer.push_back(move(SampleGraphic));
 
Yes. You probably are.
 
@Telkitty Yes.
 
@Grapes Where's your std::?
 
There is friendship between us.
 
Women don't date robots.
 
user1357851
4:18 PM
they are so compatible, don't you think, even think alike
 
also prefer make_unique to new directly.
 
@R.MartinhoFernandes Don't let a silly thing like friendship come between you.
 
@DeadMG I haven't found a good make_unique yet that works in VS2012
 
@R.MartinhoFernandes They prefer humans. pats back
 
4:18 PM
@Telkitty WTF?
 
@R.MartinhoFernandes Cheer up, hot robo chicks date robot :)
 
@Grapes Eh, just write one with the number of parameters you need when your existing overloads are insufficient.
 
I think this is leading up to
 
it's more annoying to not have make_unique than to have a slightly subpar implementation
 
4:19 PM
@EtiennedeMartel I've written some variadic templates with CTP. Enough to verify that at least some simple uses work (though not a lot more than that).
 
@Rapptz It's not.
 
user1357851
@LightnessRacesinOrbit I like to stir things up :)
 
@Telkitty Is that why you are single, and near-universally hated?
 
Stir facepalms?
 
4:20 PM
 
Not really
 
If by fix you mean "add more bugs", then yes.
 
user1357851
stiring floating pigs ...
 
user1357851
 
@Grapes I like how it doesn't bother to list the major features it adds.
Or even fucking hyperlink URLs
 
Or even link to specific items of news on the pages it references
POS Microsoft
it's like when people write "Hey! Look at today's XKCD comic! xkcd.com"; It really pisses me off. Spend two moments obtaining the permanent URL to that comic, dipshit!
 
Meh, it only annoys me when journalists do that.
 
Tomalak why are you so raged lately?
 
@Rapptz Because he's off his meds normal.
 
@Rapptz This is not "raged", sir
I am not allowed to have negative opinions about fuckface things?
I am, in fact, having rather a nice day thanks! This is, after all, what I do for fun.
 
4:23 PM
Speaking of std:: I have never actually wrote "using namespace std" in implementation files. Is it OK to do so as long as it's not in a header?
 
user1357851
yeah we all care about how we are hated on the internet. No, I am quite loved in real life unfortunately :p
 
This place is supposed to be full of rainbows and happiness damn it.
 
@Telkitty Sorry to hear that :(
 
fuck it. how many months passes since November VC++ CTP? =(
 
4:23 PM
Dunno. When did it come out?
 
@R.MartinhoFernandes The November CTP came out in November.
 
@R.MartinhoFernandes That's fucking retarded
 
@Rapptz Fuck rainbows. They piss me off! [no, not really -- just playing devil's advocate.]
 
November...
 
@LightnessRacesinOrbit hehe
 
4:24 PM
haha
@JerryCoffin I advocate the devil in all most many some a small collection of rare things
 
@Abyx In case you're serious it's 5 months. :P
 
Also thread is over in the comments of that video.
> Hitler didn't like Jews. Look what happened. :V
 
lol
 
bbiab burger king
 
4:27 PM
Apparently one of the goals of Rust is to have a type system that isn't Turing-complete.
 
That sounds like a cool book.
 
@DeadMG Does this seem ok:

template <class T>
std::unique_ptr<T> CreateUnique(T* ObjectInstance)
{
return std::unique_ptr<T>(ObjectInstance);
}
auto SampleGraphic=CreateUnique(new DisplayObject);
 
@Rapptz I don't know Swedish, but I don't think it would work well with say, German.
 
@R.MartinhoFernandes imgur.com/a/Mnn6g#0
 
Yeah, seeing that, but it isn't like the OP described.
 
4:30 PM
It's similar in concept though
From the look of it anyway
 
It's all in German with footnotes.
 
Yeah I know
 
What about this approach:

template <class T>
std::unique_ptr<T> Own(T* ObjectInstance)
{
return std::unique_ptr<T>(ObjectInstance);
}
auto SampleGraphic=Own(new DisplayObject);
 
unusual
Just use make_unique with code repetition for up to 5 arguments.
 
ah
let me write one
 
user1357851
4:35 PM
@JerryCoffin jerry, I am depressed. I think we are all slave to nature - it does whatever it does, we think we have we have freedom but we don't. We are all going to die
 
user1357851
separatly that is
 
@Grapes pastebin.com/Lhwsh9ma here's Xeo with the corrected a3 to a4
 
It's out of print.
 
posted on April 05, 2013 by Scott Meyers

A couple of months ago, I posted a draft Table of Contents (TOC) for Effective C++11. At that point, the entries for the concurrency chapter were so rough, they weren't even in the form of guidelines. Now they are, and I'm pleased to unveil my first draft TOC for the chapter on concurrency support: Create tasks, not threads.Pass std::launch::async if asynchronicity is essential.Make std::thread

 
Well, at least you have the image version.. albeit it isn't the same.
 
4:36 PM
@Rapptz thanks
 
@Telkitty I'm not at all sure we're really going to die. The majority of people ever born are still alive today. I guess I'll probably die someday -- but I'm going to have some chocolate today and probably some wine tonight...
 
@Rapptz saw the code. Is it really a good idea to use #pragma once together with #ifndef?
 
Ask Xeo, I just do include guards
 
user1357851
@JerryCoffin no one born 150 years ago or earlier has excaped death. Nobody.
 
I don't see the point of using both.
 
4:41 PM
Anyone familiar with OpenGL or WebGL?
 
No, it's a complete unknown to mankind.
 
user1357851
everytime I am feeling sick, I have this imminent fear I am going to die from it, especially if the pain is not on arms or legs.
 
user1357851
yeah I worry too much :p
 
like a normal pointer
 
@Telkitty That's essentially what Grandma Death said in Donnie Darko.
 
4:44 PM
Nevermind, stupid question
 
:8691840 Why do you pass it around? To pass ownership? Then you move (by value). If you just want to temporarily allow someone to access it, but not take ownership, pass a raw pointer, or pass the pointee(!) by reference.
 
@FredOverflow I get it, it's like a variable, so i'll use ref
void TestRef(std::unique_ptr<DisplayObject>& TestParam) {
 
@Grapes It's not stupid at all, the C++ community is still figuring out best practices here.
 
@Grapes No, pass DisplayObject by reference, or pass DisplayObject* by value. Passing a unique_ptr by reference is stupid.
 
4:47 PM
oh
void TestRef(const DisplayObject& TestParam) {
TestRef(*SampleGraphic);
 
right
 
thanks fred
 
At least that seems to be the consensus around here.
 
WebGL has the old OpenGL API?
 
What's so funny about "right"? "Right said Fred"?
 
Xeo
4:49 PM
On line 44, you have std::forward<A3>(a3) twice in a row :) — FredOverflow 38 mins ago
 
WebGL is ES 2 I think
 
Xeo
@FredO What?
 
@R.MartinhoFernandes kinda, yeah.
I think it's based on OpenGL 2.0?
 
Right Said Fred is an English band based in London and formed by brothers Richard Fairbrass and Fred Fairbrass in 1989. Guitarist Rob Manzoli joined the duo in 1990. The group is named after the song which was a hit for Bernard Cribbins in 1962. With over 20 million CDs sold worldwide, the group has achieved Multi-Platinum status and has also won two Ivor Novello Awards – for I'm Too Sexy and Deeply Dippy. Before forming Right Said Fred, the Fairbrass brothers had played with Bob Dylan, David Bowie and Mick Jagger. 1991-1992: I’m Too Sexy and Up In July 1991, they released their...
 
Xeo
@FredOverflow I didn't reply to a specific message. I meant your comment.
 
4:51 PM
  std::forward<A3>(a3), std::forward<A3>(a3)));   // errata
  std::forward<A3>(a3), std::forward<A4>(a4)));   // corrige
 
Where is that?
 
The only instances of a3 in that page are in your comment.
 
5
A: Is there a way to write make_unique() in VS2012?

XeoYou could use Boost.Preprocessor to generate the different parameter counts, but I really don't see the advantage of that. Simply do the grunt job once, stuff it in a header and be done. You're saving yourself compile time and have your make_unique. Here's a copy-paste of my make_unique.h header...

 
Xeo
@FredOverflow Oh. In the copy-pasted code.
 
4:52 PM
> Here's a copy-paste of my make_unique.h header that simulates variadic templates for up to 5 arguments.
 
Xeo
I thought I somehow generated that...
 
Maybe you have a bug in the generator.
 
@Xeo You suck either way.
 
Xeo
Nah, I copy-pasted that header together. :D
A loooong time ago
 
:lol: "generated"
 
4:53 PM
Not generated: suck. Generated broken: suck.
 
And nobody noticed until now. Which probably means that nobody uses constructors with 5 arguments :)
 
Nobody uses that header
 
I remember the puppy recently expanding his to six.
 
@CatPlusPlus That would also explain it :)
 
I generate things to 10 arguments
 
4:54 PM
@R.MartinhoFernandes STL always says that the MS lib can be configured up to 10. "It still does not go to 11" :)
3
 
You stole my joke you bastard
 
Xeo
@FredOverflow STL is awesome.
@CatPlusPlus lawl
No lolcat++ anymore?
 
@CatPlusPlus If anyone, STL stole it.
 
The beard question isn't generating rep caps anymore. I hate you @Xeo.
 
Why? Design goals can be whatever you want. Whether they are achieved is a completely different issue.
 
4:56 PM
Tell me with a straight face that File.delete() does not interfere with any other operations on the host.
 
hmm... AI project + seminar for 9 credits, no exam, or some other seminar + OOP course with exam for 6+3 credits...
 
Well you can sandbox I/O easily
 
But it isn't. Not from the inception, and not in any implementation in common use. So much for "basic philosophy".
 
Yeah: C++'s philosophy is "you don't pay for what you don't use", a corrolary of which is "we don't dictate your use case - use these tools as you see fit" ... until they decided to name something that performs no moves std::move, because "most people will use it just before performing moves"
flag THAT
 
4:59 PM
To be fair only idiots will use it in other situations, because it does nothing.
 

« first day (902 days earlier)      last day (4050 days later) »