« first day (1047 days earlier)      last day (3907 days later) » 

9:00 PM
I still don't understand, but I'm glad I helped!
 
I seem to have forgotten. Is the rules for generating the special member functions, if you don't, it does, for each individually? (in that, defining one has no result on the generation of another).
 
@MooingDuck It's hard to understand questions from the ignorant(me);
 
@Pawnguy7 no, they're all interdependant and quite confusing
 
user1804599
Fuck me, but WordPress is awesome compared to all the other shit out there.
 
@MooingDuck Ah. Well, on the bright side, if I mess up, I will know at compile time.
 
9:12 PM
@Pawnguy7 if you write any constructor, it no longer generates the default constructor. If you write any copy/move constructor/assignment, it no longer generates any of those. ish.
 
user1804599
Wrote a plug-in and not a single class was given.
 
Ah. I get that, yes.
Like, there are... is it 5 special member functions now?
 
@Pawnguy7 T(const T&)=default;T(T&&)=default;T&operator=(const T&)=default;T&operator=(T&&)=default;
@Pawnguy7 six. destructor.
 
user1804599
Hmm.
 
Ok. So, constructor, copy constructor, move constructor, assignment operator, move assignment operator, destructor.
 
9:14 PM
I like lua, it has no destructors, but weak tables
 
@Pawnguy7 yes
 
If I do anything with the first type, does it affect any of the others? (and the same, for each).
I understand it will no longer make any in its own type, I am asking if it affects the others.
Like, for example, if I made a constructor, and it no longer made me a destructor, and similar relations.
 
user1804599
Are named pipes ever used?
 
user1804599
I've never seen them used in practice.
 
@Pawnguy7 with the first type?
7 mins ago, by Mooing Duck
@Pawnguy7 no, they're all interdependant and quite confusing
 
9:19 PM
@MooingDuck Or category, if you would rather.
 
6 mins ago, by Mooing Duck
@Pawnguy7 if you write any constructor, it no longer generates the default constructor. If you write any copy/move constructor/assignment, it no longer generates any of those. ish.
 
If you write a move constructor, it doesn't generate move assignment, copy assignment, or copy constructor
 
Ah.
So you can sort of follow the rule of, "if they specified they wanted this, if they wanted it possible any other way, they would define that also"?
 
> What does downloaded mean? Is this not a disc format?
Ah, YouTube.
 
@Pawnguy7 ish. You can write conversion constructors and assignment operators, and it will still generate move/copy constructors/assignments for you.
 
9:22 PM
copy and move stuff generation is a bit weird
what's this?
 
Define conversion constructor.
 
I think I want to rename put(r, out) so that I can flip the order of arguments: foo(out, r).
 
@Pawnguy7 a constructor that takes a single argument of a different type than that of the one being constructed. string::string(const char*) (ish)
 
I would consider that a normal constructor with arguments. Is it special compared to, say, Coord(int x, int y, int z)?
 
@Pawnguy7 well, to be fair, you can write any other constructors and it wont affect move/copy. But it will affect the default constructor.
@Pawnguy7 it allows implicit conversions. Other than that no.
 
9:26 PM
What's a move constructor ? (I know only ctor and dtor)
 
@MooingDuck Well, there's still the case of {1, 2, 3}
 
@user2626195 The default constructor is the one that gets called for no arguments. The copy constructor takes a T& or const T& and isn't a template. The move constructor takes a T&& and isn't a template. conversion constructors are all other constructors that can be called with a single argument. constructors taking multiple parameters have no special names.
@chris that's not really an implicit conversion IMO
 
copy constructor takes in T&?
Class(Class&) = default would tell you the signature is incorrect IIRC.
 
@Rapptz I can look it up again, but I recall that it does
 
@MooingDuck Well, it's not allowed when the constructor is marked explicit, so it kind of folds on itself a bit like that. I've only ever heard a construction being called a conversion constructor for one, though.
 
9:30 PM
Copy ctor takes T& or const T& as a first argument, and has no other non-defaulted arguments.
 
@Rapptz spec says it's allowed. § 8.4.2
A function definition of the form:
attribute-specifier-seqopt decl-specifier-seqopt declarator = default ;
is called an explicitly-defaulted definition. A function that is explicitly defaulted shall
— have the same declared function type (except for possibly differing ref-qualifiers and except that in
the case of a copy constructor or copy assignment operator, the parameter type may be “reference to
non-const T”, where T is the name of the member function’s class) as if it had been implicitly declared
 
I saw an example with S(S&); //OK and stopped looking.
 
auto_ptr has copy ctor with non-const ref.
 
I keep finding out things I don't know today. Apparently one of them is how to make a templated member function.
 
@CatPlusPlus Good point.
@Pawnguy7 You still don't, or do now?
 
9:34 PM
I found this, but apparently I did it wrong, because it isn't compiling. Or by template statement is incorrect, I am not positive which.
I am also interested in the why, though (if they both must be in the header).
 
@Pawnguy7 sample in the question looks good to me
 
@Pawnguy7 A small example of a compilation error would probably be best to explain.
 
template <typename = typename std::enable_if<std::is_base_of<Particle, T>::value>::type> is this valid, by itself?
 
Define "by itself"
 
I also had tried T in place of the second typename.
 
9:36 PM
No
You need a proxy type
 
Um... as a template statement, I guess.
 
template<typename U = T, typename std::enable_if<std::is_base_of<Particle, U>::value>::type...>
 
The idea behind it was, only accept template arguments that are subclasses of base (particle).
 
@Pawnguy7 no, where is T?
 
@MooingDuck I'm guessing in the class template.
 
9:38 PM
I don't know. I assumed it was the argument.
 
@Pawnguy7 ...
 
I didn't make it.
 
@Pawnguy7 you realize nothing in this discussion has anything to do with member functions and everything to do with how templates work?
 
@Pawnguy7 lol
I guess I shouldn't assume something when it comes to Pawnguy
 
Given I don't know A or B, I cannot very well tell you which of them causes the problem.
 
9:41 PM
@Rapptz Can't have void non-type parameter.
 
is enable_if magic?
 
@Pawnguy7 If you are still learning templates, leave enable_if and type_traits alone. They get tricky REALLY fast
 
@Pawnguy7 Yes, it was the result of some lucky and powerful undefined behaviour.
 
I never would have touched it, but I had a design issue.
 
@chris pretty sure it's well defined now
 
9:44 PM
The alternative is overloaded functions, though maybe that is a better idea.
 
@MooingDuck I have to take the blame for suggesting it. He wanted his function to only take types that were derived from a specific class.
 
You didn't suggest polymorphism?
 
@Pawnguy7 prefer overloads to templates
 
user1804599
You know.
 
user1804599
C declarator syntax is a bit like PIC in COBOL.
 
9:45 PM
@Rapptz Umm, I guess I was in the wrong mindset. I forgot about polymorphism.
 
Here is my situation. I was making a particle class, and manager. (particles are dumb). Anyway, I wasn't sure how I could add them, because whatever they refer to will go out of scope.
My plan was, allocate a copy of it, and use that.
 
Templates are polymorphism.
Don't write ~managers~
 
Any alternatives?
 
@Pawnguy7 call it something else and ignore the cat
 
I mean, at least it isn't static this time.
I figured it was ok in this case, as it manages rather dumb objects, and is more convenient than... for lack of a better word, doing it raw.
 
9:50 PM
It's a symptom of poorly defined responsibility.
"Managing" is meaningless.
 
Call it ParticleThingy instead
 
The next best word that comes to mind is ParticleCollection, but it also updates and draws them, which I would call managing, since it delegates the drawing and rendering on a per-particle basis.
 
A class should do one thing, and one thing only. Any time you say "it does this, but it also does this and this", you're doing it wrong. That's why "managing" is a symptom of bad design.
It's called single responsibility principle.
 
If I wanted a collection of particles, I would get a vector.
 
I like the idea that the rest of your code that's not in a Manager is a mess that doesn't keep track of anything.
 
9:54 PM
Say you had a Ship class with information like power, speed etc, and a GraphicalShip class with stuff needed to draw it, with one containing the other. Is that a reasonable design or not?
 
@StackedCrooked What are you talking about?
 
I saw it used in an Android game beginning tutorial thing while I was trying to pick up specific information I needed to make one in less than two weeks.
 
@chris I would think something else would draw it, among other things. But I am not good at design.
Or, perhaps, something like ship_instance.draw(graphic_window)
 
Well, the graphical ones were added to the stage as actors in the library used.
 
Maybe a proxy would be good, that knows ship and graphic and can translate ?
 
9:57 PM
I'm still terrible at design. I have no idea which designs and patterns are good or bad, really. I probably need to find a good book about it.
 
Anyway. Should I go with overloads?
 
@LucDanton I guess you need an optimiser geared for a different style, I guess.
 
My optional uses placement new + static storage, I imagine it hinders static analysis.
 
guys what's the behavior of delete nullptr
Like do we have to check? or will the OS....
 
As far as I know, delete checks itself.
 
10:08 PM
It's no-op.
 
@R.MartinhoFernandes I heard you're a bad ass.
 
No, he's a bad robot.
 
@R.MartinhoFernandes I heard you're a bad robot.
fixed it
@CatPlusPlus I'm only afraid of you because of how much my girlfriend loves you
for your name/picture
damn cat lovers.
 
fffffffffffffff fucking duplication because silly language
How come struct foo { ~foo() = default; /* ... */ }; may or may not have the same meaning as struct foo { foo() = default; /* ... */ }; foo::~foo() = default;? Who thought that would be a good idea?
 
@Chemistpp What did I do?
 
10:28 PM
And now prototype does not match any in class :|
Time to define everything inline.
 
@LucDanton I always define everything inline - can't be arsed to write member declarations twice
 
It used to be that I could just look at a class definition to remember how the interface went. The more bells and whistles I add, most of them not implemented as members, the less it matters.
Well those are class templates mind you, I still use separate compilation when I can get away with it.
 
@R.MartinhoFernandes usually when being given praise, we don't get worried why, but for coliru is what I was told
 
lol
@Chemistpp That was @StackedCrooked, not me. He was joking.
 
'void std::vector<_Ty>::push_back(Particle *&&)' : cannot convert parameter 1 from 'TestParticle *' to 'Particle *&&'. Why can I not add Derived * to a vector of Base *?
 
10:36 PM
Damn, a friend of mine has a real good qustion
 
@R.MartinhoFernandes did you not really produce corilu?
 
@Chemistpp No. That was @StackedCrooked.
 
@R.MartinhoFernandes LOL
what a guy
 
"I've overloaded -> and * but the parent class is a template so I must use 'this->' to set members, if I say this->data = something; as data is a template param, it actually uses operator->...."
 
@StackedCrooked You troller. You're the BA behind corilu
 
10:37 PM
He has a really good point, how do you access class members, when -> is overloaded.
 
@AlecTeal *this.data
or use std::addressof
 
* is also overloaded.
It's some sort of smart pointer from what I can gather.
 
@AlecTeal not for T* it's not.
 
this is a pointer, won't use UD operators.
 
@R.MartinhoFernandes I got tickets for Gravity :D
 
10:39 PM
Of course, thanks guys :)
 
operator-> is the only magic one
 
@willj Awesome!
 
Trying to keep my expectations modest
 
I thought magic was when you didn't have to impliment anything, just declare it in the header and it all worked.
 
error| expression cannot be used as a function
||              active = false();
^not sure what went through my head.
 
10:43 PM
"please enter a different workspace folder, more than 100,000 files out of date". Well that's not good.
 
Yay me, I "suggested" smartPtr.get().data() instead of smartPtr->data() >.>
 
Haha, changing my optional implementation broke the ana tests.
 
@MooingDuck I still don't really get how operator-> works tbh.
 
Gah. I just completed my online technical assessment for that job interview. I'm strangely kinda pumped now. That's an odd feeling.
 
You return a pointer.. and it just works?
 
10:47 PM
Perhaps s/odd/old/
 
@Rapptz it's just magic. The more you study it, the more it breaks every rule of sanity
 
You can return anything, as long as it itself supports ->, then the call continues on that result.
By transitive closure it does mean something will have to return a pointer, though!
 
@Rapptz it recursively calls -> until it gets something where -> isn't overloaded :/
 
I meant when you overload it, it's usually pointer operator->() { return internal_ptr; }.
 
magic is the syntax requires for any C++ prog to work.
 
10:51 PM
@sehe programming test?
 
@willj mostly. It wasn't too bad, actually. But I kept feeling really pressed for time
I think I took about 45 minutes (of 81 minutes allowed), though the initial questions had a time limit of 1 minute.
 
the type of test says a lot about the company - bad tests put me off!
 
It had some longer tasks that ranged from 10 to 25 minutes
 
I liked the test for my current gig - it just said "write an allocator"
 
@willj It used codingame.com, not a bad experience. I still wrote the assignments in Vim, obviously
 
10:54 PM
Welp, all the constructors were correct except for the very last one that forgot to set up an invariant.
 
@willj Wow. That's a steep request unless you could access the webs. Also, what was the time limit, and were there any specific requirements
 
So, let's say I program someting in C++, could an appropriate SO question be asked to evaluate it?
 
One of the tests was to find the file universe-answer somewhere in the subtree of /tmp/documents. With just standard libraries, obviously. That was kinda painful.
 
@sehe No timelimit, just a set of requirements to implement, take as long as you want
 
It's a huge question that oculd include both subjective and objective answers
 
10:56 PM
@Chemistpp Fix your English, will you?
 
they were looking at the code quality
 
@sehe no. that's 100% correctly written.
 
@willj I think I'd like that better. Or, you know, maybe a really interesting task and then limit it to 3 or 5 hours
@Chemistpp Really. Plonk
 
@sehe maybe written ambiguously, but it's correct English.
 
@Chemistpp I spent ~4 minutes rereading it to see the error.
 
10:57 PM
I happened to have written an allocator with the exact same set of requirements already ;)
 
There isn't one (aside from the typo of someting to something).
 
@Chemistpp Questions can be asked to evaluate whether someting is correct English.
 
bairns hurt
 
@sehe damnit sehe. wtf are you? A fucking grammar bot?
 
It's grammar, and.. it's spelling.
 
10:58 PM
@Rapptz You posted that <2 minutes after the subject message :/
 
@Chemistpp Yes, you should definitively post on SO.
 
@sehe My sense of time is off. whistle.
 
@Chemistpp I'm shooting down inane questions in chat. Using any ammunition I see. Not anything in particular.
 
@sehe well, then it's a valid defense mechanism. Though, I'm afraid to ask real questions in chat.
 
That's by design.
 
10:59 PM
Theory behind good questions are still subject here though
@sehe oh, of course
 
@Chemistpp You might want to fix it. Hint: particles matter. Subject/verb congruence matters. The choosing the noun that represents the right concept matters even more, and that's not even being a grammar Nazi!
 
@sehe Absolutely.
Though, it's a broad question.. Here is 30 files, a goal, and the output, any suggestions? Doesn't seem like a good SO question.
 
So, this line means what? I still can not get its meaning!! — user2517676 4 mins ago
Code Review (don't make them long..)
 
@Chemistpp You are chaining sentence fragments together. We are supposed to extract something out of your word soup. I don't wanna play.
Plonk it is
 
@sehe maybe my english here isn't repesenting the style of question I wish to ask. It's at least 2 months away so this is just an exercise apparently.
@sehe Maybe our language usage differs.
 
11:03 PM
Wait. You are planning to ask a question on SO in 2 months. Makes sense. And because it's such a long time away, it "apparently" is just an exercise. Make oodles of the same.
 
My sentance was to represent a few segments of "simualted" correspondence. Maybe an exercise only played by the english.
 
?!?!
I hereby sentance you to death by klilflie
 
I'm saying explicitly: I have 30 files of code. I have 0 bkg in knowing fi they are well coded. I want to ask someone. Is it acceptable on SO to post a question in which I provide my 30 files (fulfilling previous knowledge/effort/wtf ever requirement of prev. knowledge) and my goal, is it an acceptable question to ask for input?
 
Code review?
 
@Pawnguy7 I guess that's how it would be worded by someone who has done this before.
 
11:07 PM
Not certain if this is what you mean, but there is this:
 
@Pawnguy7 seems to be the basis of my question. Though, reading back through it, I still don't understand how this needed more explanation
 
I am still confused what you are asking. Is this solved?
 
> - Traversal: forward (NYI)
lol, I may have been overpessimistic here
 
@Pawnguy7 Jesus, I quit. The question was "Let's say I code something, can I ask an appropriate SO question to evaluate it?" (Obviously, it should mean "the code" but clearly it's not the case. In short it comes down to: Can I ask a question that doesn't have a simple answer. This violates "opinion" based questions BUT could include several non-opinion based ideals.
 
@Chemistpp Did you already click the link to codereview.stackexchange.com ?
 
11:14 PM
@willj yes.
My respone to it was just below it.
where I thanked him :)
 
Then why would you want to post your code on SO, if you can post it on Code Review?
 
@willj Because I just heard about it 5 posts up
before I posed the question permaters here before pposting on SO
because posting on SO prematurely leads to death, taring, feathering, and other shit I"m trying to aovid.
 
you were given a response: post on Code Review instead
 
What's that rhetorical device for saying heads when you mean people (part to mean a whole)?
Oh wait, found it.
 
@chris Metonymy.
 
11:22 PM
@LucDanton I was thinking more synecdoche.
I used to know all of these off the top of my head in English class lol
 
Yeah the two cross-breed IIRC.
 
Yeah, they're pretty close.
 
I'm actually not too sure how to implement e.g. group(istream_range(std::cin)), or if it's even worth doing.
 
@willj I'm not fucking arguing.
I was asking in general. i was given a response, so your answer is out of context.
 
11:45 PM
Welp, implemented it.
 
@LucDanton Didn't take you too long.
 
Are nicknames italic when someone ignores you?
 
No.
It means they're room owners.
 
Oh ok.
 
11:52 PM
Good to know.
 
In less than an year my name will be italic. MUAHAHAHA
 
Finally got particles working.
Those look a lot better in motion.
 
And then I'll kick everybody out and take control of room #10 by myself.
 
Is that a single draw call?
You can't kick as a room owner (being one is pretty useless)
 
@Rapptz but you can de-op (remove ownership)
 
11:54 PM
Really depends how you define single draw call.
 
You only call draw once.
O_o
 
I have like four draw functions.
SFML's window.draw?
 
Wait
You do stuff.draw(window) or window.draw(stuff)?
 
In SFML, normally the latter. Least, for builtin stuff, and I have never used anything not built in.
 
Oh so you don't make your own entities.
 
11:57 PM
@Rapptz Hmm. You can make your own entities with window.draw(stuff).
 
I know you can.
 
I think you can extend... Drawable, maybe? Or something like that. Never saw the need yet.
 
Then why you say you don't?
 
I didn't say I don't.
@Pawnguy7 sf::Drawable and possibly sf::Transformable.
 
1 min ago, by Rapptz
Oh so you don't make your own entities.
 
11:58 PM
..Yes.
 
I assumed that was directed at me.
 
Yep.
 
It was.
 
Do you define your own?
 
Yeah I typically do
 
11:59 PM
I'd say it's good design to define your own game objects with names that make sense rather than Sprite.
 

« first day (1047 days earlier)      last day (3907 days later) »