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

user142019
11:00 PM
It traverses the AST and keeps symbol tables and keeps track of scopes. It produces a new tree with type-annotations.
 
Ell
@BartekBanachewicz why are they bugged?
 
@Ell ask AMD driver devs??
@Pawnguy7 I still do
 
Ell
haha okay :L
 
I would rather use my iPad as a GPU than buy an AMD card
oh come on @LightnessRacesinOrbit
 
@LightnessRacesinOrbit recommending Notepad? You barbarian.
 
Xeo
11:10 PM
> You've earned the "Great Question" badge for What is this smiley-with-beard expression: “<:]{%>”?. See your profile.
 
Well... the people over at SFML looked at the project file, and found nothing wrong. If it isn't in the project file, what could it be? :\
 
@Pawnguy7 Borked install?
 
I don't know how you could tell, or how I could have done it - it is an installer, after all.
 
I think this is a case of PICNIC/PEBKAC
 
@Borgleader yeah, the PEBKAC one
so, uh.
See you tomorrow.
 
11:17 PM
cya
 
Ell
Bye now
 
Hey, Quick question. If I have a variable in a different class that owns that variable, how should I access it? What kind of smart pointer should I use?
2
 
Ell
which class owns which variable?
 
let's say 2 classes exists
 
Ell
yeah
class A and class B
 
11:22 PM
wtf
 
B has reference to A
A owns the variable
 
what variable?
make an example in code
 
error| non-static data member declared 'auto'
|| friend auto operator+(Self<T...> lhs, Self<U...> rhs)
wut
Appears to be a limitation of C++1y mode.
 
Ell
@Grapes just use a reference then
 
ok let me get a better example
 
Ell
11:26 PM
@Grapes If there is no ownership involved, you don't need a smart pointer
 
@Xeo What do you make of this: liveworkspace.org/code/4mpQ5Z$0
 
That LWS links are terrible
 
@ScottW no pastebin?
 
Or I guess chat's parser
 
@CatPlusPlus Really annoying. I wanted to check with Clang though.
 
Xeo
11:28 PM
@LucDanton Wait, what is the question?
 
@ScottW Hold on, my dial up is still uploading the text
 
Xeo
The comment and code in main talks about *, the codei n V talks about +...
 
@Xeo 'Is this correctly rejected?' and 'Can I achieve what I want, differently?' are both interesting.
Oh neat, that means that works. Thanks.
 
user142019
I just wrote the ugliest Haskell code that's been in existence since ever.
 
11:29 PM
@ScottW I still use C89
 
ONE LINE. You can make this example in ONE LINE.
struct A { int theVariable; }; struct B { A& myA; }; // now continue...
 
Xeo
@LucDanton lol
 
@Zoidberg I have little doubt.
 
@Xeo New question: I can't improve the Crtp wrapper to vary on the Policy can I?
I mean in a customizable way.
 
Xeo
So it was a PEBKAC problem? :P
 
11:30 PM
In my defence I'm super hungry.
 
not hyperhungry?
 
struct Stage { std::vector<std::unique_ptr<DisplayObject>> DisplayObjects; } How would I go about adding one of the items in DisplayObjects into another vector? Would I have to use a shared_ptr?
 
Just checked the kitchen and I forgot to turn on the heat. So as you can tell, hunger makes me stupider.
 
Xeo
@LucDanton template<int P, template<int, class...> class Self>?
@LucDanton kek
@LucDanton Or where exactly did you want to vary on the policy?
 
@Xeo The goal is for the CRTP wrapper to be as close as possible in functionality to the hand-written operator.
So check that operator: it allows for mixed operations on V<I, T...> and V<I, U...> but not e.g. V<I, T...> and V<J, T...>.
 
11:33 PM
@Grapes Who owns them
 
@CatPlusPlus Stage should own DisplayObjects
@CatPlusPlus so it's a vector of unique_ptr
 
Then stage keeps unique_ptrs and the other thing keeps normal non-owning pointers
 
@CatPlusPlus so it's still fine to use pointers right?
 
Xeo
@LucDanton So.. operator+(Self<P, T...>, Self<Q, U...>)? Sorry if I don't quite the see question / problem.
 
@CatPlusPlus non-owning
 
11:34 PM
Yes
 
@CatPlusPlus Thanks, that's great
 
You should never have owning raw pointers is the thing
 
@CatPlusPlus yep, that's great
 
@Xeo What if I write a template<int I, int J, typename... T> class W;, how do I use the CRTP wrappers? Those wrappers are write-once, use many.
 
Xeo
Oh yeah, and operator+= would also need to be adjusted, I guess.
 
11:35 PM
@CatPlusPlus so this is ok? pastebin.com/mTXSCnPD
 
Xeo
@LucDanton Okay... do you want to allow variance on the int parameter(s) or not?
 
@Grapes Pointer is not necessary here
 
@Xeo Yes and no. The sides must match, but the actual value doesn't matter.
 
@CatPlusPlus why not?
 
user142019
@Grapes return reference or throw exception.
 
11:36 PM
@Zoidberg what if I want to return nullptr?
@Zoidberg like null in c#
 
user142019
29 secs ago, by Zoidberg
@Grapes return reference or throw exception.
 
user142019
There is no "or return null" in that sentence.
 
I'd probably return optional
 
Xeo
@LucDanton Will it always be ints?
 
user142019
That's also possible if exceptions are not appropriate here.
 
11:37 PM
@CatPlusPlus it is. So it's ok in that case?
 
Also don't do for-if, use std::find
 
If I could write templates that accept several packs I could require that the alias passed to the CRTP wrapper be of the style template<typename... Context, typename... T> class Self -- first pack would need to be deduced for both args, the other would be individual.
 
I mean optional<T&>
Pointers have ugly syntax fluff
 
Xeo
@LucDanton Well, there's always pack<Context...> with partial spec..
 
@Xeo Is that deducible?
 
Xeo
11:39 PM
If you mean Self<pack<Context...>, T...>, Self<pack<Context...>, U...>, yes, it should be.
And if you mean Self<Context..., T...>, Self<Context..., U...>, then also yes
 
@CatPlusPlus so it's ok except std::find or any more stuff?
 
@Xeo No it's not.
 
Xeo
as Context... is fixed already.
 
user142019
Shit.
 
@Grapes Yeah
 
user142019
11:40 PM
My grammar is context-sensitive. :P
 
Xeo
@LucDanton But don't you pass that into the CRTP base?
 
@CatPlusPlus Thanks. is std::find really that much better?
 
user142019
Ah fuck it I will use do instead of the name of the monad for do-notation.
 
@Xeo That wouldn't achieve much. Only operands matching that particular context would be accepted. I could just scratch the context parameter altogether and have the alias take care of that.
 
Xeo
11:41 PM
Oh, wait, I think I see what you want. You want to allow any Context..., as long as both sides match, right?
 
user142019
@Grapes yes.
 
Yes. So it's deduced in the operator.
 
user142019
It expresses your intent immediately: you want to find something.
 
Xeo
pack<Context...> it is, then
 
I'm skeptical.
 
11:42 PM
std::find syntax is just so awkward compared to c#/php/js/java
 
user142019
Yes, but PHP, JS and Java are outright retarded.
 
user142019
And in C# you use LINQ instead of foreach-if.
 
@Xeo What does the alias look like for V then?
 
PHP is #1 programming language of all programming languages, of all times... all times.
:) Just kidding
 
user142019
#1 in the top shitty languages.
 
11:45 PM
auto test_variable=make_unique<DisplayObject>(); then pass it as &(*test_variable) and use it as you would a normal pointer
anything wrong with that logic?
 
Xeo
> warning: function 'V<pack<policy_1>, int, long>::operator+=<double, short *>' has internal linkage but is not defined
wait, what
@LucDanton What alias?
 
user142019
@Grapes .get() not &*.
 
@Zoidberg oh yeah forogot
 
@Grapes Why not DisplayObject v; and then use &v?
 
Xeo
@LucDanton Oh gawd, that class name.. it's been haunting me these past two weeks with AS3.
 
11:47 PM
@LucDanton this is just examples
 
@Xeo What do I pass the CRTP wrapper?
 
@LucDanton I would use stack as much as possible, just making examples
 
user142019
@Grapes it depends completely on the context and use-case.
 
Xeo
@LucDanton liveworkspace.org/code/4DL5mr - the class template itself?
 
user142019
It's not "good" or "bad". It depends on what you want to do.
 
11:47 PM
@Grapes Okay so when you asked 'anything wrong with that logic?' you weren't really interested in an answer then.
 
@LucDanton I think zoidberg answered it, I'll use .get()
 
user142019
lol
 
@Xeo And you didn't think the crucial step 'this requires that all clients be written in the form template<typename Context, typename... Rest>' should be mentioned?
 
Xeo
So you want to use it for types that carry a context, and for types that do not?
 
@Xeo That would be easy -- write an alias that ignores the context.
The would-be technique rests on passing aliases to template template parameters -- have you toyed with that?
 
Xeo
11:50 PM
@LucDanton Then I don't understand the question, sorry.
@LucDanton Not really, no
 
@Xeo It's insanely powerful.
 
Xeo
Well, I can see that, since it can pattern-match to things the original type could not
 
Suppose I want to write an operator* for std::vector (let's ignore how daft that is -- the std:: part is obviously not important). I can choose to operate on either std::vector<T> or the full template std::vector<T, A>.
It's not uncommon for a class template to have one or more template parameters as policies and have the 'essential' interface be independent of those -- I don't need to care about allocators to use a vector, most of the time.
 
Xeo
Mhm
 
Can I connect the two via a CRTP wrapper? I don't like writing operators.
 
11:53 PM
 
Oh, I think I should ignore non-type parameters for the type being.
 
Xeo
Yeah, those add a whole new level to this thing, I think
@LucDanton Okay, so the original plink to me felt kinda like an XY question.
 
Wow, looks like if I use a member alias template of a class template deduction still takes place? How fucked up is that?
 
Xeo
Code?
 
@Xeo The original plink was just looking at the immediate situation of making the dumb proof of concept even work.
@Xeo It's not interesting.
The member alias wasn't dependent when used in the operator signature.
 

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