« first day (897 days earlier)      last day (4052 days later) » 

6:00 PM
aha!
how bad is it from scale 1 to 10?
 
what do you mean, "how bad is it".
you asking me to fix your problemos?
 
just name a number
 
@DeadMG actually, yes. (No point to hide it, huh?)
 
get lost Tomalak.
 
6:01 PM
Lol
 
It's a legit problem.
I mean Puppy you obviously don't have to.
 
it says: error : no instance of overloaded function "boost::variant ..
 
he just said what's wrong
the problem is, how to fix it
because I honestly have no idea
I don't know if it makes sense to force it that much
I mean, the syntax is nice.
but as I already said, well, might break
 
wow
-1 to my faith in your C++ skills
 
Exactly.
 
6:04 PM
it took me about three microseconds to see the answer
and I'd have thought it would be simple for you too
 
so don't spoil it
let me think a bit more.
 
I'm not going to
 
also don't forget I can't C++
 
Xeo
What's the problem?
 
9 mins ago, by DeadMG
the variant has a template constructor
which apparently thinks it's a better match than copy constructor and conversion operator
 
6:14 PM
@BartekBanachewicz typedef boost::variant<int, string, bool> var; var a = 10; var b = "Bartek"; var c = false;
 
i have tried making the conversion operator explicit, but that gave me a linker error
@KhaledAKhunaifer and what does it add to the discussion?
 
@BartekBanachewicz what is "conversion operator" ?
 
facepalm
let me google that for you
 
I know it with different name
 
s/different/wrong/
 
6:18 PM
apparently
17
Q: Why is copy constructor called instead of conversion constructor?

Luchian GrigoreSo basically this code: class A { }; class B { B (const B& b) {} public: B (){} B (const A& a) {} }; int main() { A a; B b1(a); //OK B b2 = a; //Error } only generates an error for B b2 = a. And that error is error: ‘B::B(const B&)’ is private Why is it...

constructors are weird.
 
how exactly would one get a camera to look at where the mouse is pointing in OpenGL?
There is probably something for that, right?
 
define "at where mouse is pointing"
mouse is a pair(x,y) of coordinates
 
Like every FPS ever made
 
...
rotate the camera by how much the cursor has moved!?!?
 
use y to rotate around X axis and x to rotate around Y axis
 
6:22 PM
@BartekBanachewicz can I do something like this: template <class T> class Foo { T data; template<class S>Foo::operator S(){ return ((S)data); } };
 
@KhaledAKhunaifer C-style casts are usually a sign of something being wrong
 
@BartekBanachewicz I know, but that's not the question
 
the question is just bad.
 
my question is, can I use template<> with conversion operator
 
even if you can you shouldn't ever
 
6:26 PM
@KhaledAKhunaifer Nevermind .. Forgot to remove Foo::.. Yes you can actually. Compiles here.
 
I don'y know, maybe wrapping Variant into actual class would work
no wait no.
 
Ell
JS & css is driving me up the wall
 
@BartekBanachewicz Why not? This seems like a legit use case.
 
@Borgleader this is template constructor, no?
 
@KhaledAKhunaifer Something like this? liveworkspace.org/code/3XbT6c$0
 
6:31 PM
@BartekBanachewicz Yes, but you get the idea. Converting from a Vector2D<T> to Vector2D<T2>
 
@Borgleader hmmm
converting a variant from Proxy
not Proxy to Variant, but Variant from Proxy
no, it's not good enough.
fucking shit.
 
@BartekBanachewicz reinterpret_cast hurr durr.
 
that's totally not solving my problem either
 
15
Q: What is "chat with an expert"?

AntonyA box just comes out of nowhere which says "chat with an expert". It happened once on Stack Overflow and once on Meta. Is this an ad? Isn't Meta supposed to have no ads? FYI, here's the code for that weird box: <div id="adviza-box" style="width: 380px; "> <div id="adviza-status"&...

^^ lol
 
it's April Fools
lol.
 
6:37 PM
Not here :( yet...
 
Lawl.
 
I can't.
I don't know.
I need a hint, @DeadMG.
:(
 
wow spoilered!
 
nothing "wow" about it
 
Ever realized that having DiffMerge to compare different versions of the same source code helps tremendously?
And I took them for granted.
:(
 
6:54 PM
Could someone tell me why there isn't another "normal constructor!" on the end (before printing v3)? RVO maybe? liveworkspace.org/code/20ctZi. (not my code by the way)
 
@Tuntuni sorry I puked when I saw raw pointers
hi @kbok
 
@BartekBanachewicz Why lol?
 
@Tuntuni because raw pointers are terrible
 
@BartekBanachewicz They're not .. It just depends on how the programmer uses them. Of course they're dangerous if you don't know what you're doing but without them stuff like shared_ptr wouldn't exist.
They're the foundation.
 
@Tuntuni so don't use them if you are not writing a smart pointer
 
6:57 PM
@BartekBanachewicz Well this is just an example. I also wrote "not my code by the way".
It is actually from here codeproject.com/Articles/397492/… but I'm just trying to see what is called where.
 
you are responsible for the code you post, regardless if it's yours or not
 
@BartekBanachewicz Well using it as an example won't hurt anyone. :D
 
@Tuntuni it can possibly hurt noobs who will then use raw pointers
 
@BartekBanachewicz Let them use it. And let them learn from it.
 
@BartekBanachewicz Of course. Everyone will get bitten by them sooner or later ..
 
7:00 PM
uh, whatever.
 
bitbucket.org/Rapptz/gears/src/… I probably could have done this without raw pointers
but I used em anyway
 
@Rapptz Laik a baws.
 
@Rapptz wanna fucking biscuit?
 
@ScottW It begins.
 
Yes.
 
7:02 PM
@Rapptz it's noncopyable
 
I know that.
 
by design?
 
Yeah
 
oh welp okay.
std::array is. just sayin'
 
So could someone tell me why there isn't another call to the normal constructor (before printing the contents of v3) here liveworkspace.org/code/20ctZi? Could it be RVO? Something else maybe?
Edited link.
No idea ..
 
7:04 PM
I mean what.
how does it compile.
 
@BartekBanachewicz One is const, the other one isn't
 
@Rapptz oh damn missed that
 
Hah, removing the evidence.
Coward!!! :D
 
still this return specification is kind of misleading here
 
Is return specification the term for that?
 
7:05 PM
Oh you don't return *this o.o
 
It's usually reference/const reference
 
The thingy with ->
 
It seems weird to do auto /* */ -> regtype
 
@CatPlusPlus yeah, returning a value is weird
 
@Rapptz Why?
 
7:07 PM
@Rapptz Yes, my thought exactly.
 
That's kind of what it does
 
because trailing return type is not required here
 
So what?
 
@CatPlusPlus Maybe you could tell me why but why would you do auto f() -> double vs double f()?
 
so using it just for kicks is...
 
7:07 PM
It's arguably prettier
 
misleading
 
Oh. Because Haskell has similar semantics?
 
And you can align declarations neatly, because the prefix is constant
 
and against the convention
 
@Rapptz What?
There is no convention
 
7:08 PM
there is.
 
@CatPlusPlus For type specification, :: Double
 
No, there isn't
 
or whatever
 
return_type function_name (param_list)
that's 99.9% percent of C++ code
or possibly more
and if it's not a convention for you then fuck I don't know what is
 
So basically it's an aesthetics thing?
That's all I was asking, I don't care about conventions
 
7:09 PM
they are indentical here, so yes.
i.e. produce the same function signature
 
In other words: You just got trolled so badly that you had to make a meta post. :) — Mysticial 1 min ago
 
vm["a"] = 4; // works
vm["foo"](4, 5, 6); // works
 
@Mysticial Lol.
 
cout << vm["a"]; // doesn't work
so yeah um. well.
 
@BartekBanachewicz Overload the << operator for whatever vm["a"] returns?
 
7:13 PM
@Tuntuni it'not that simple
 
@BartekBanachewicz Why?
 
@Tuntuni because the returned type is a Proxy type.
 
Should I use the copy-and-swap idiom only with the copy assignment operator?
@BartekBanachewicz Actually ..
 
@Tuntuni and putting it into iostream is just one of possible use cases
 
@BartekBanachewicz wut?
 
7:15 PM
@Tuntuni Proxy is a way to set a value or get a value of lua variable. It's not a value
 
@BartekBanachewicz so change gluLookAt() ?
 
@Crowz not using gluLookAt would be nice, yeah
 
I think I need to learn some math before I do OpenGL... hah
 
@BartekBanachewicz Well then just called get() (or whatever you use ..) on it and pass that to the ostream?
 
@Tuntuni it isn't that funky then
 
7:17 PM
@BartekBanachewicz lolwot
 
just finished learning C++ templates
5
 
@KhaledAKhunaifer AHAHAHAHAHAH AADAASHHAHAHA
Oh my \
 
Lol.
 
dude warn next time
I am going to choke or something.
 
@BartekBanachewicz I'm not good at C++
 
7:18 PM
@KhaledAKhunaifer so wtf with that statement?
 
@Tuntuni uh I had a solution with get an hour ago
the point was to allow reading from proxy itself
 
@BartekBanachewicz I wrote a code on what I learned, check it out: coliru.stacked-crooked.com/…
 
also
auto foo = vm["foo"];
foo(4,5,6); // works
 
@Borgleader I saw that, Deus Ex is one of my favorites
 
7:20 PM
@Borgleader Content unavailable?
 
@Crowz Tomorrow is April 1st... so this is an aprils fools hence the "so cruel"
 
@KhaledAKhunaifer that's quite basic stuff
 
@Borgleader April Fool's day? Hah I forgot about that
 
ModelView Matrix = ModelMatrix * ViewMatrix, or is it ViewMatrix * ModelMatrix?
 
@BartekBanachewicz what do you think about VarList ?
 
7:22 PM
@BartekBanachewicz I was afking.
 
@KhaledAKhunaifer Lol the var's class member data is public, yet you've made accessors for it.
 
2
A: Sight vector in OpenGL

Bartek BanachewiczOkay, now after you clarified what you really want to do, I'm pretty sure this is the correct answer: You are probably used to something called ModelView matrix. Didn't it seem strange for you that it's essentially combined of two parts? Well, it was for me, and after I thought about it for a wh...

@DeadMG I figured. And I need a hint.
 
Checking...
 
@Tuntuni it was on the go ..
 
well
 
7:23 PM
@KhaledAKhunaifer Still. :D
 
the hint is that, since you are not going to be changing the possible types that Lua can have very often, you can simply wrap the variant in another type that does not have a template constructor.
 
What is that???
 
@KhaledAKhunaifer it's, uh, useless
 
@Tuntuni but is there a way to store the class\typename\class name along with the object ?
 
@tom_mai78101 an aprils fools you nub
 
7:25 PM
@Borgleader Noooo. :(
 
@Borgleader Wut? It's 3/31 here.
 
@KhaledAKhunaifer To store the type that was passed in?
 
@KhaledAKhunaifer yes, use a template.
 
@tom_mai78101 Timezones, its 4/1 somewhere
 
I have 35 minutes to go before 4/1
ok
 
7:26 PM
@DeadMG I thought about that, but rejected in the process.
Apparently the only way then.
 
@KhaledAKhunaifer typedef the type of the template inside your class as value_type or something.
 
@Tuntuni is there an example for that ?
 
@KhaledAKhunaifer There is now: typedef T value_type;.
 
Wow, took a joy ride with the April Fools' joke, it's quite a blast.
 
@Tuntuni I see .. thanks
 
7:28 PM
1
A: Is Ongoing Support chat in StackOverflow is a Bot?

EAGER_STUDENTOh!!! I never expected to be fooled off by stack-overflow at this very very very early morning at twelve. I now realized that I have crossed 12.00 PM in INDIA and today is ARPIL 1.

^^ pwned...
 
@Mysticial Lmfao, I can't believe people keep falling for it.
 
They should make spaceship hulls out of singletons... — Kerrek SB 1 min ago
 
@Tuntuni It's rare.
 
@Cicada lol
 
7:29 PM
@Cicada hahahahahaha
 
@KhaledAKhunaifer Something like this liveworkspace.org/code/3BJkpV.
 
@Tuntuni I got it
@BartekBanachewicz don't insult my classes
 
@KhaledAKhunaifer you mean?
typedef boost::variant<signed int, double, bool, const char*, nil> _Variant;

class Variant : public _Variant
{
public:
    Variant(signed int v) : _Variant(v) { }
    Variant(double v) : _Variant(v) { }
    Variant(bool v) : _Variant(v) { }
    Variant(const char* v) : _Variant(v) { }
    Variant(nil v) : _Variant(v) { }
};
compiles, but doesn't work
i.e. gives incorrect resutls.
 
_Variant is reserved.
 
@R.MartinhoFernandes ah crap indeed
 
7:35 PM
Everything that starts with an underscore and a capital letter is, iirc.
 
yes
oh wait I fucked.
2
 
@BartekBanachewicz Not following the rules, are we now? :)
 
@Tuntuni I just renamed it dude
 
@BartekBanachewicz you said "Ah um, useless" .. my classes are not useless
 
@KhaledAKhunaifer that one was.
 
7:37 PM
@BartekBanachewicz Should have thought of it before. ;D
 
@Tuntuni uh, I forgot. Chill out.
 
@BartekBanachewicz I'm joking .. hence the smilies all over the place.
 
@BartekBanachewicz how do you decide if something is "useless"
 
@KhaledAKhunaifer dude that class allowed you to store objects that didn't have anything inside
 
@BartekBanachewicz it was a quick illustration
 
7:39 PM
and nothing else
how useful you think that is?
 
when I complete the classes, it will be very useful
 
@KhaledAKhunaifer what for?
Also
 
@BartekBanachewicz I can build a local database
 
I AM VICTORY
@KhaledAKhunaifer that isn't even remotely related to those classes
 
All your variants are belong to Banana Sandwhich
 
7:41 PM
vm["a"] = 4;
auto p = vm["a"];
auto pv = lua::Variant(p);
std::cout << "OMG " << pv << endl;
// works!
@Borgleader exactly!
I can't cout it directly though.
It would imply two conversions,
let's try with explicit stream ops
 
I know this is not C++, but if I open a POSIX pipe then fork, will I get the SIGPIPE on the read end only if both the parent process and the child process close the write end?
or as soon as either one do
 
if you know it's not C++ why ask here?
 
even if it would be C++
 
because that's the closest I'll get to a POSIX room
 
7:50 PM
no, C room is closer
 
is there actually a C room
 
Ell
man I've been awake for > 36 hours
 
@zneak yes
@Ell look what I did :)
 
Wtf, the (*) part of a function pointer can be removed? So just saying int() means I want an anonymous function pointer as an argument. T_T
Never knew.
 
user142019
int() is the type of a function returning int and taking no arguments.
 
user142019
7:51 PM
int(*)() is the type of a pointer to such function.
 
user142019
They are not the same.
 
@Tuntuni don't use C function pointers
 
Ell
@BartekBanachewicz Woo well done! but I'm confused - what is the type of p? I would assume initially that p should be lua::Variant and that pv wouldn't be needed?
 
I should bind some keys for "Don't use X"
 
@Zoidberg Oh?
 
7:52 PM
@Ell p is lua::Proxy. Variant is a copied value
 
@BartekBanachewicz Not just pointers, any C in C++ code is bad
 
Let me check that out with a static assert. :3
 
@JABFreeware except when you are writing a wrapper
 
Ell
So you can assign to proxy?
 
@BartekBanachewicz not so to " you are responsible for the code you post, regardless if it's yours or not"
 
7:55 PM
@Ell yes
@Ell you can also call a proxy, if it points to a function
I mean, you can call it even if it's not a function
which will generate proper Lua error
Lua ERROR : attempt to call a number value
I am pretty proud of this.
 

« first day (897 days earlier)      last day (4052 days later) »