19:28 < PsychoGod> hi all, it's me again xD 19:28 < PsychoGod> who can explain, plain_range_sorted class in base/range.h 19:30 < PsychoGod> why it use typedef plain_range, if it has already start and end variables by inheritance of plain_range class ? 22:05 <@matricks> PsychoGod: inspecting the code 22:07 <@matricks> PsychoGod: the plain_range_sorted garantuees* that the range of values are sorted 22:08 <@matricks> PsychoGod: algorithms like partition_binary requires that the supplied range has the sorted-concept 22:08 <@matricks> PsychoGod: it's there for compile-time error checking 22:09 < PsychoGod> why not to use normal inheritance of class ? 22:09 <@matricks> it does? 22:09 < PsychoGod> with added sorted function 22:09 <@matricks> that is what it does 22:10 <@matricks> it inheirits plain_range 22:10 < PsychoGod> it makes range::start = not start = 22:10 <@matricks> you mean parent::begin? 22:11 <@matricks> can you point out the row that confuses you? :) 22:11 <@matricks> https://github.com/teeworlds/teeworlds/blob/master/src/base/tl/range.h 22:12 < PsychoGod> 198 22:12 <@matricks> yeah, that is just accessing the plain_range fields, dunno if the parent:: there is needed 22:12 < PsychoGod> return plain_range_sorted(parent::begin+start, parent::begin+start+count); why not ? return plain_range_sorted(begin+start, begin+start+count); 22:12 <@matricks> it can be that you need to specify which parent you wanna access 22:13 <@matricks> due to template usage 22:13 < PsychoGod> parent is only type, so it can't have variables ? you just can use that functions ? 22:14 <@matricks> no 22:14 <@matricks> it specified which one of it's inheirited classes to access 22:14 < PsychoGod> typedef plain_range parent; 22:14 < PsychoGod> this parent ? 22:15 <@matricks> class A { int vv; }, class B { int vv; }, class C : public A, public B { C() { vv == 5; } } 22:15 <@matricks> class C inheirits from both A and B, both A and B has a variable called vv 22:16 <@matricks> now C sets vv to 5.. which variable does it set? the one in A or the one in B? 22:17 <@matricks> the compiler can't know, so you have to specify it.. { A::vv = 5; } 22:17 <@matricks> same thing going on in the plain_range_sorted class 22:19 < PsychoGod> i thought that it makes while class C : public A something like class C{int vv; C() {vv == 5;}} so it makes not A and B, it makes C variable changed 22:19 < PsychoGod> when it looks for B int vv; it just skip it 22:20 < PsychoGod> anyway parent is typedef, not class 22:20 <@matricks> typedef == alias 22:21 <@matricks> easier to write parent:: instead of plain_range:: everywhere 22:22 < PsychoGod> but if you inheirited class A in class C, you can easly have C::vv so why use alias ? 22:23 <@matricks> just easier to write, and a bit cleaner 22:24 < PsychoGod> so it's just like to know that begin is from parent class ? 22:24 <@matricks> yes, I think it has to be there to not confuse the compiler if I remember correctly 22:30 < PsychoGod> ok, thanks for explanation ;) it wasn't last ask xD will be more another time ) 22:31 <@matricks> :P 22:31 < PsychoGod> :3 22:32 <@matricks> I should hunt for gear 22:33 < PsychoGod> D: my english can't understand this , could you write another form ? xD 22:33 <@matricks> I should look for gear to buy 22:36 < PsychoGod> gear for what ? 22:36 < PsychoGod> D: 22:36 <@matricks> paragliding gear, looking for tandem gear 22:36 <@matricks> also, swedish movies: http://i.imgur.com/LxWj9aZ.gif 22:37 < PsychoGod> xD 22:37 <@matricks> https://www.youtube.com/watch?v=Wsc5_Ziy710 22:37 < Nimda3> [YouTube] Title: Kopps | Rating: 4.90/5.00 | Views: 169,266 22:37 <@matricks> now with sounds and shit 22:44 < PsychoGod> n1ce shot xD