« first day (1035 days earlier)      last day (3928 days later) » 

12:01 AM
I can't remember, are chars promoted to int when going into a variadic function?
 
@Ell It's difficult to come up with good examples, because you quickly run into self-contradictory requirements. The main (apparent) improvement with GC is that you avoid copying by passing pointers instead of copying complete objects. Unfortunately, most current GC copies objects that remain "alive" through a GC cycle. So, the advantage comes when you create an object, pass it around to a lot of functions, but then destroy it before the garbage collector runs.
If you don't pass it around much, then you wouldn't be copying much, even in C++. Conversely, if it stays alive though many GC cycles, it'll get copied a lot even with GC.
 
from what I could tell from cppreference this is the correct form
 
Fuck me, there are some shite question about tonite. Unsigned char>255 etc. Maybe better stuff when I've sobered up.
 
@JerryCoffin why do you have to make copies if you don't have GC
 
@A.H. If you pass by value instead.
 
12:05 AM
whats the problem with good old pointers? (smart)
 
@chris Assuming varargs, then yes.
 
wtf?
http://stackoverflow.com/questions/18263459/exceeding-unsigned-boundary#comment26785967_18263459
 
@LucDanton Ah, thanks. That's what I get for using variadic templates instead of those.
@A.H. Yeah, those will get you. I remember watching STL's video on them.
And I keep forgetting things that happen.
 
@Xeo Yes. It's very handy indeed.
 
12:07 AM
@chris you mean that everytime I add two lets say shorts I get an int ? even if I am assigning to a short? like compiler actually generates a temp storage for the an entire int?
 
@A.H. Yeah, from what I remember, everything smaller than int is converted.
 
dare I ask why?
 
@A.H. Depends on the situation. As mentioned above, for multithreading, you end up with (slow) atomic increment/decrements for your shared pointers. Even for single threading, you run into places things get difficult, like the pages and pages of specs in the C++ standard about lifetime of temporaries, when it's extended to the lifetime of the reference to which it's bound, etc.
 
@A.H. Uhh... uhh... because C.
 
@JerryCoffin wouldn't GC also add overhead not that different from atomic reference counting ?
 
12:13 AM
@A.H. yes, but relocated to non-CPU-critical times.
 
or when the user blinks
 
@A.H. floats are promoted to doubles too
@A.H. also, "an entire int" is pretty small.
 
@MooingDuck yeah , but not what I expected is this like required by the standard?
 
@A.H. yes.
 
Fucking C shit C++ is a different language GET RID OF THE MORONIC IMPLICIT CONVERSIONS!
 
12:16 AM
@A.H. It depends. If you're using GC for everything (e.g., Lisp or Smalltalk) then the overhead from using something like Generational Scavenging is much lower than using reference counting. For something like C++ where local variables are just values, and you'd never reference count them anyway, I'm a lot less certain.
 
so does this mean that using types that are smaller than int is pointless?
 
@MartinJames D and C# are better for that mindset :)
 
@A.H. that question is missing an action
 
hehe yeah
fixed
 
@chris So is Delphi, (which I use a lot).
 
12:17 AM
@MartinJames I've seen a bit of that in relation to winapi. It looks foreign to me :p
 
@A.H. not even remotely. Basically, what it comes down to, is char/short/int is about storage space, not mathematics. It always uses int for math. With the exception of 64 bit integers. Then it's storage and math.
 
@JerryCoffin I have no idea wtf Generation Scavenging is
 
@A.H. Well, int is supposed to be the natural type.
 
but sounds cool
 
@A.H. Well, it has to at least act as if that happened. In a typical case, however, to add two shorts (for example) it's going to load each into a register, then add the registers -- and int is supposed to be the natural size suggested by the architecture, so a register will usually be that big anyway.
 
12:18 AM
@JerryCoffin or bigger
@A.H. in modern CPUs, registers are like 64 bits anyway. It might be slower to not promote it.
 
@A.H. A form of GC that doesn't use reference counting. It tries to improve speed by basing collection cycles on generations of objects -- objects that have lived a long time are assumed will probably live longer, so they don't get collected as often.
 
@MooingDuck It might be slower, but it also might be WRONG!
 
@chris I thought the x86 can do shit directly with memory
 
@MartinJames umad, bro?
 
@A.H. not to my knowledge, but my knowledge is pretty lacking in the details of CPUs
 
12:21 AM
@A.H. Eh, I'm not a great person to talk to when it comes to stuff that low level.
 
@A.H. IIRC, all computers can do that.
 
well I know the instruction can take one memory operand (for add)
 
@MooingDuck Well, yes, that too. Just for example, starting from the Pentium II, the internal registers of an x86 were actually 80 bits wide (internally, there's one set of registers used for either integer or floating point).
 
so that means on 64-bit they are promoted to long longs ?
 
@MartinJames x86 can use memory for one operand of almost any instruction. Most "RISC" CPUs have load/store instructions that interact with memory, and all other instructions only operate on registers.
 
12:22 AM
@ThePhD A bit. Pissed and looking at mind-blowingly moronic stuff on Multithreaded etc. Maybe I should just go to sleep before I piss everyone off :)
 
@A.H. they aren't, for reasons I don't understand.
 
@MartinJames Nah, it's okay. :D
 
the Intel AVX-512 extension for the x86 architecture has 512 bit registers O.o (for SIMD)
 
@JerryCoffin Isn't it that basically all GCs before generational were almost unusably slow for most applications?
 
Removing implicit conversions would break a lot of code
 
12:24 AM
@MooingDuck thats the SIMD stuff right?
 
@A.H. yeah
 
Though the only one I really like is construction of objects.
e.g. "hello" can be std::string when passed to a function
 
@MooingDuck ..because all implicit conversions should be sent for a tour of duty in Afghanistan, with T-shirts having a target on the front and a 'Please IED me' plea on the back.
 
@MooingDuck What's more surprising is that they don't just cut the crap and go to like, 16KB or something.
 
though UDLs would make this a non-issue.. ("hello"s)
 
12:26 AM
@Rapptz Which was unfortunately voted into the Standard.
 
@DeadMG Unfortunately? I find it quite useful.
 
string_view would have been a much better choice.
 
@DeadMG I thought it was useless at first but I guess Luc convinced me it isn't all useless.
 
@DeadMG No, not really. In fact, Java (at least Hotspot) still doesn't use generational scavenging. Lisp and Smalltalk were used for quite a while before generational scavenging came along (late 1980s, IIRC).
 
@Rapptz I didn't say that it was useless.
it's just less preferable than string_view.
 
12:27 AM
@Rapptz Removing all implicit conversions (including promotions) would be pretty silly and useless. The major point of public inheritance is to support implicit conversion.
 
@DeadMG for a register?
 
@DeadMG What's string_view? Just a const string?
 
@Rapptz a const string interface. The string might be a literal, or a std::string, or a CString, or a const char*, or a _bstr_t, or a random chunk of memory in a file.
 
@Rapptz It's a class that offers basically the same interface as const std::string&, but you can use it to refer to a const char* without having to make a copy.
 
@MooingDuck Implied.. but okay.
 
12:30 AM
@DeadMG Not at all. Addition requires a carry chain, so larger operands limit your clock speed (or force multi-cycle operations).
 
@JerryCoffin Being multi-cycle isn't a real problem. The only question is, "Would it be faster than a bunch of loading into 512-bit registers, adding, and then storing back again?" which would most definitely be multi-cycle.
 
@DeadMG I can't even figure out how that would work
 
Is '' preferred to "" in JS?
 
@Pawnguy7 Don't take my word for it, but I don't think it really matters much to anybody.
 
@DeadMG That's not the only question at all. The main question is whether it's worth penalizing operations on smaller operands even a tiny bit just to gain some minuscule improvement on huge ones. Given the number of operands that huge compared to the number of smaller ones, the answer is clearly not just no, but oh hell, fuck no!
 
12:34 AM
I don't know. I feel like I see '' everywhere, but I don't know if there is a practical reason behind it.
 
'The wife and family of Abu Qatada have left the UK, five weeks after the radical preacher was deported. They flew from Heathrow to Amman in Jordan on a scheduled flight yesterday after voluntarily agreeing to leave and to abandon attempts to stay in Britain permanently. They were driven to the airport by Home Office officials at lunchtime'.
Fuck me, I want a lift to EMA next month for my vacation. I was going to let Anne do it, but maybe I should advocate blowing up of UK servicemen instead.
 
And yes, you can expect (probably major) penalties on smaller operands if you went to gargantuan registers. Just loading an operand that's 16K wide takes quite a while, so adding two of them would take a long time, even if it caused no problem for the CPU itself at all.
 
@JerryCoffin wouldn't that register be extremely expensive too ?
 
@MartinJames We don't have enough officials to do that for everyone who wants a lift leaving the country.
 
@JerryCoffin Soddin' memory bandwidth always gets forgotten, especially by the brain-dead morons on Multithreaded who insist on non-blocking spinlocks over huge operations. Fuck me, I need to go to bed before I ruin yet another keyboard with my forehead.
@DeadMG Yeah - I'm not 'radical' enough.
 
12:40 AM
@A.H. Yes, but it's mostly a matter of balancing things -- given current transistor budgets, they could build something with (say) 1024 bit registers pretty easily. The question is whether you'd gain more by dong that, or by using that silicon space for other things. Latter will nearly always win.
 
I'm off - I know when I'm ratted and out of control :) BFN.
 
@MartinJames cya
 
What is the law that is double in two years?
 
Moore's
 
@MartinJames G'night.
 
12:42 AM
fuck, why do I always think better in the dark :(
 
You do?
 
@DeadMG Relaxation improves thinking.
 
well I guess that not having anyone else around to potentially interrupt is a plus
 
Hmmm.
 
12:48 AM
the hell are all thsese >> somenumber
 
replies
it's a lot
 
It's a dump of the number of Polish whores in London, aparrently. Why am I still here?
 
can you get a working visa as a whore sex worker?
 
I should apply for jobs, or someshit.
 
@Telkitty猫咪咪 I know in the US it's mostly illegal, so I don't expect it's possible to apply as a sex worker to get a VISA in the U.S.
 
12:58 AM
@Rapptz lol, I enjoyed the guys thoughts.
 
Ell
Illegal in Uk
 
I don't know if other countries actually have it as a dedicated profession, or if it's still mostly an under-the-table job.
 
@Borgleader >>You know about C++ lounge but not 4chan?
 
@ThePhD Australia has legalized brothels, I believe.
 
Ell
Nevada doez
 
12:59 AM
plus, of course, you could work in the sex industry as a porn actor/actress.
 
So I could go visit Telkitty by applying to be her Sex Worker?
 
Las Vagas has legalized prostitution
 
who'd want to visit Telkitty?
 
the rest are like shit I wouldn't fuck for loot.
 
I want to visit everyone in the Lounge.
 
Ell
12:59 AM
I want some food
 
Oh, but we also have "Escorts"
 
be like deciding to go for a swim, and then deciding to swim in a sewer
 
@DeadMG haha, exactly.
 
I might have to come back to the UK because there's apparently like A MILLION MORE PEOPLE there, such as @LightnessRacesinOrbit @Ell and @MartinJames . Even @KonradRudolph
 
Escorts are of debatable legality. You pay them to go on a date with you.
 
1:00 AM
If I have a 6 year old laptop, if I were to get a new one, would it be, approximately, 8 times faster?
 
Sometimes you get lucky
 
Hm. I wonder if I can make < autocomplete with > but not when I'm doing less/greater than.
 
@Pawnguy7 Probably a bit less, because 2x transistor doesn't mean 2x performance. But having an SSD vs not is night and day, so that will make a big difference.
 
@Rapptz are you making an IDE?
 
@Rapptz You'd need a complete C++ compiler for that to look up the name and find that it's a template.
 
1:01 AM
No just customising ST2.
 
Still thought, there's other people to meet.
 
Ell
@thephd yes do come back! A time when I can meet you
 
@ThePhD Do hookers become more expensive when they are illegal?
 
I need to raid Germany to meet @Xeo, @R.MartinhoFernandes, @sbi, and @melak47.
 
@Rapptz oh, well if it's possible, you could check for a ( or a if/else statement prior and ignore if one exists. I don't know st2
 
Ell
1:02 AM
Let's all raid Germany!
 
@Telkitty猫咪咪 Black Market anything means price is based on region and availability. Usually, more expensive.
 
Ell
Err
Yea.
 
@Chemistpp Would absolutely not be sufficient.
 
@Ell Ja! Das ist richtig
 
@DeadMG I would make pessimistic assumptions when dealing with this, but I wouldn't think it would drop to many orders of magnitude. Anyway, what about SSD?
 
1:03 AM
@DeadMG eh, I was spit balling. I did somethingl ike this for .lua which is a much simpler.
 
Damn.
 
And then, I need to get to the Netherlands for @sehe and @rightfold, and then swing over to Poland so I can bother @BartekBanachewicz and @CatPlusPlus.
 
I made < complete with > but if I type > then it doesn't override it.
I suck at this thing
 
Ell
And Norway to visit alf
 
@Pawnguy7 A fast SSD can definitely transfer at about 8 times the data rate compared to a mechanical drive, probably more compared to a laptop old hard drive.
 
1:03 AM
@ThePhD what about the rest of us?
 
@A.H. I don't know what country the rest of you are in.
 
@ThePhD well I am in Egypt
 
:effort:
 
@A.H. gotta have 500 rep for a visit.
:/
 
having an SSD is a massive boost.
 
1:04 AM
@Chemistpp better go answer some shit
 
@A.H. bahaha. I earn by asking
 
Oh, and there's @StackedCrooked in ... ... F... France? No, wait, he's in Belgium! And @Rakkun and @kbok are in France.
 
@DeadMG oh yeah. It's like going from dial up to 20 mbit.
 
France will be a bit harder to navigate. Hopefully they're both outside of Paris. ._.
Paris be crowded. And is full of dogs. ._.
 
@ThePhD ThePhD is not allowed in Paris after last time...
deja vu?
 
1:06 AM
Australia, though.
 
@DeadMG Ah, ok. I imagine I will also get better than OpenGL 2.1. Assuming integrated graphics card, any idea how current support is?
 
I don't know how the hell I'm going to get to Australia.
@Telkitty猫咪咪 Why the hell do you have to be in such a far-away place? D:
 
@Pawnguy7 That really depends on how fresh a CPU you get. The latest Intel integrated graphics chipsets really aren't that bad, and the same for some of the AMD APU stuff.
but you would want to check your specific CPU before making a decision.
 
Ell
Amd apu graphics is much better
For price point especially
obviously CPU is lacking
But you can get cheap 4.3 cards
 
Good point. I am sure I can research it.
 
1:09 AM
the latest chipsets support DX11/OGL 4.1, I think.
@Ell Not really.
the APU graphics don't justify their price- you can get better CPU and GPU performance with a discrete card.
 
@ThePhD that's the question I have to ask the rest of you :p
 
Should I document my stuff early or later?
 
Ell
What was the not really to? I'm mobile
 
I feel as if I do it early I won't have to bother as much later.
 
@Ell That AMD APU graphics are much better. They're not.
 
1:11 AM
@Rapptz It'll be excruciatingly boring anyway.
 
Ell
Price wise they are imho :3
 
@CatPlusPlus Yep.. Documenting stuff is shit.
 
@Rapptz You mean, later when you refactored it all in light of some new requirement or design and then all your old docs are useless? :P
@Ell Well, go tell it to all the benchmarks, where the stuff I've seen quite disagrees.
 
@DeadMG Good point.
 
I would only doc a project when it's ready to be shared/re-used, or to be more useful, when a specific component meets the latest requirements.
 
1:14 AM
Yeah but when I do it later I get too lazy from the boredom and lack of motivation so I never finish.
 
Ell
I enjoy writing documentation
 
@Rapptz So yeah, it was std::search :D
 
@Rapptz That's not really going to change just because you do it earlier.
 
@ThePhD Yeah I know.
 
what I'd suggest is that you never finish because you have nobody asking you for the docs.
 
1:15 AM
I know you know. I'm just letting you know that I know, and that I know that you know.
 
which kinda implies that you don't really need to doc it.
 
@DeadMG I think I get unmotivated because of the amount of docs I have to do.
 
Because I heard you like knowing, so I figured you can know while I know and we can know altogether.
 
So I kinda end up not doing it.
@ThePhD ?_?
 
@Rapptz :D
 
1:16 AM
just think of how much you're being paid to write the docs.
 
@ThePhD 馬鹿外人
 
Noooo
y u write with Kanji. :c
 
it just says baka gaijin
 
unlike some of us
 
Idiot... idiot outsider?
 
1:17 AM
no, wait, don't you work in a hospital?
 
Idiot foreigner?
HEY I'M NOT AN IDIOT FOREIGNER. D:<
 
I don't get paid to write docs or code
 
eh
 
I do it for fun.
 
then don't write any docs.
just wait for people to come complain to you that you don't have any, and then write as little as is possible to keep them satisfied.
why write a whole bunch of docs for a personal project that nobody else uses?
 
1:18 AM
@Rapptz いいえ!
 
I wrote docs on building Wide only because a couple other Loungers asked me how to build it.
 
So it feels complete really
 
@ThePhD Something I can read and understand? Inconceivable!
 
nothing is ever "complete".
 
wow.
LLVM cannot handle UNicode characters.
Fuck you, LLVM.
 
1:19 AM
lol
 
What is it
even encoding it as?
 
@ThePhD Define "handle".
 
I can't even fucking tell, holy shit.
240 259 141 140
 
why would LLVM have anything to do with Unicode, ever.
 
Those are the four byte values it gives me for Bananas
@DeadMG Unicode identifiers?
 
1:21 AM
LLVM doesn't have identifiers.
that's for source languages, not intermediate languages.
 
I see.
 
and secondly, considering the purpose of LLVM, it's really, really not unreasonable to expect frontends to convert from Unicode into something else, like \Uxxxxx, for a Unicode character.
 
0xF0 0x9F 0x8D 0x8C <-- It matches the UTF8 banana hex code sequence.
I wonder why it's not showing up as such.
 
showing up where?
 
Ah, there we go!
I got it. I had to fix my debugger engine types.
But, it now is correctly showing my namespace A { struct 🍌 {}; }
2
 
1:31 AM
lol
you know, I usually consider Null Object to be an anti-pattern, but I think I just decided I have a use for it.
 
How much water do you guys drink in a day? (ml)
 
really goes in leaps and bounds
I drink maybe 200ml on a normal day, and then up to 1.5l or even more if my mother bought Coke recently.
 
wow that's awful
 
why?
 
drinking that much pop in a day is terribly unhealthy
 
1:38 AM
hey, all the ingredients are listed as "Trace", including sugar.
 
200ml isn't a lot in a day either :s
 
the stuff is so cheap, they couldn't put in anything other than water and carbon dioxide and still make a profit at 8.5p/l.
 
I drink 1.5 to 2 L of water a day.
 
also, it might well be less than 200ml a day.
I sometimes drink nothing at all for more than one day in a row.
and I have no idea how many ml goes in a glass.
I kinda eyeballed it at about 100ml.
 
I haven't measured, but I am pretty sure it is less than it should be.
 
1:40 AM
@DeadMG usually 250
 
oh, then probably quite a bit more than 200ml.
but definitely not more than 500ml.
also, I'm pretty damn sure this glass does not hold 250ml.
hmm... maybe it does.
I wonder if I should have a LinkedIn?
 
@Pawnguy7 Daily recommended is usually spouted at about "8 cups a day" which is 2 L a day but in reality it's 4 cups so 1 L.
 
sometimes I wonder if I'd get more done if I exercised or drank more.
instead of spending practically every hour of every day at my machine.
 
I wouldn't be surprised if most days it was <= 2. When not doing much. After playing tennis is a different story.
 
hmmmm
I officially hate LinkedIn.
 
1:44 AM
Do tell.
 
well, if you're a job seeker, you have to list your previous job.
I mean, I hate to break it to you, but my previous job was five years ago on a checkout and I doubt any future employers will give a shit.
 
@DeadMG I hate that shit
what if I am new?
 
right.
 
why the hell would a starter position require work experience?
why do internships require work experience? !!!?!?
 
@A.H. The real question is, why can't you get an internship if you're looking to start a career if you're not on a university course?
 
1:46 AM
@DeadMG what do you mean by not on a university course?
 
@A.H. If you want to apply for an internship at Microsoft, you have to be due to start your third year of university.
you can't just get an internship if you want to start a career and you're smart.
 
what if I am past third year?
 
then fuck you.
 
I can't find a C++ internship in Egypt
everyone is using Ruby/Java/some shit I don't want to touch
 
I am not sure if I am terrible at web development, or just because I have not really tried.
Does anybody here do much of that?
 
1:50 AM
no.
 
web development is very different from application development
 
So it would be understandable that I wouldn't know it?
 
well AFAICS it's the hip thing to do and a lot of companies want web dev.
 
Someone who is very good at application development might not be good at web development, vice versa
 
but there's still lots of non-web-dev stuff.
 
1:53 AM
I suppose it would be good to at least try both. I feel like I am avoiding anything weblike for some reason, but I don't know why.
Perhaps it had something to do with, um... distribution.
 
because it seems inherently obvious to me that most web developers do not know shit about what the fuck they're doing.
and also it's a lot harder to play with webdev without paying for a server.
 
If I ever actually finish, say, one of my C++ projects - mostly games - I could give them to people. But - yes, what you said at the end there.
And then there is internet explorer :D
 
oh yeah
the whole web browser compatibility thing is just a barrel of laughs
 
I wonder if that has gotten any better.
 
if you want to be good at web development you have to know servers really well
and databases
 
1:57 AM
I feel it means something that Microsoft has articles on how to uninstall each version of Internet Explorer and upgrade to the next.
 
Most powerful servers sits on unix/linux based environment
 
There are some distributions made specifically for that purpose, correct?
 
so basically you want to become a good web developer, be suffice in unix/linux first :p
 
A valid point. I would, but the VM is slow - and learning things when it takes a second to react to a click isn't fun - and I am to afraid I will screw something up to actually install it.
Anyway, as you said, lots of things are moving to the web now. I cannot say how it is for development, but I think in terms of usability, it is very good. Coliru, for example.
 
damn
why is LinkedIn so certain that I might know Chris Taylor?
 
2:05 AM
1
Q: std::unique_ptr vs std::shared_ptr vs std::weak_ptr vs std::auto_ptr vs raw pointers

CaseyWhat are the equivalent uses of each smart pointer in comparison to similar (but not limited to) some advanced techniques using raw pointers? My understanding is minimal, but from what I can gather: Raw Pointers: Only use if you really, really, really, really, know what you are doing and have ...

 
2:32 AM
well
now that I lost 36 pounds, I'mma go back to my doctor again and complain loudly that this course of action is proving of little effectiveness
 
yesterday, by Luc Danton
If zip(a, b, c) returns a zip_range<A, B, C> which has a member zipped_ranges which is a tuple of the, well, zipped ranges, what happens for round_robin(a, b, c)?
^ I'm back to this.
 
@DeadMG grats man. Don't be lame like me and gain it back over 3 months
36 lbs is a lot to go.
 
yesterday, by Rapptz
robin_range<A, B, C> which has a member robin_ranges.
 
@LucDanton What is round robin? a, then b, then c, then a, then b, then c?
 
:)
 
2:39 AM
@DeadMG ye, and it skips over those that get empty early.
 
this seems rather akin to flatten to me.
well, not identical.
 
Zip composes horizontally, flatten vertically, round robin interleaves.
 
what are the requirements on type similarity for the round robin ranges?
like, do a, b, c have to be the same type?
 
(Well the 'vertical'/'horizontal' thing can be interpreted the other way around.)
@DeadMG There must be a common type.
 
ok.
 
2:41 AM
Well, common element type to be more precise.
 
yeah, that's not the same thing at all :P
what you would really need is some version of std::get that takes the index at run-time.
or perhaps some kind of base class holder where you can have a run-time interface to which range you are using.
 
One thing that put me off implementing round_robin proper is that I did some timings.
 
@DeadMG Common element type, and ability to access elements in similar fashion, so mixing (for example) list<int> with vector<int> with deque<int> (or vague analogs thereof) shouldn't be a problem at all.
 
Surprisingly the naive 'recursive' version lends itself quite well to compiler optimizations. Whereas the 'static dispatch table' approach I've favoured in the past leads to fire and disaster (performance-wise).
 
Recursions aren't really that slow.
They're just slow when they're misused.
 
2:45 AM
@DeadMG I also have just reinvented Boost.TypeErasure to do just that. Not for the prospect of implementing a range combinator with that though.
@Mysticial I don't think the knee-jerk reaction is needed here.
 
@LucDanton Right. You can choose between either O(N) using an index and iterating through for a kind of run-time std::get, or, you could look into an array (or some kind of intrusive linked list) of RangeBase<CommonElementType>*.
 
@DeadMG When I take the second option it's more of the 'table of type-erased function pointers' approach.
 
@LucDanton That definitely wasn't a knee-jerk reaction.
 
@LucDanton Yeah, but if you use inheritance you could at least make the compiler generate the function pointers for you :P
 
You go static constexpr erased_fptr* table[Size] = { &erased_function<T>... };
@DeadMG Writing the hierarchy is a chore, and I would feel the need to test for things.
 
2:48 AM
well, if it's that simple to generate with variadic templates, I'd skip writing the hierarchy too.
 
Note that the erased function can even come from a lambda expression, too. It's really compact.
(Warning: this will crash your compiler.)
 
well
I think I'mma email WGP and tell them I can't attend because gallstones.
 
Like so: static constexpr whatever table[Size] = { [](void* p) { return std::get<N>(*static_cast<Types*>(p)); }... }; and you get a table of getters. The one caveat is that you need to generate the N... indices in tandem with the Types....
 
@DeadMG WGP?
 
worthless government people.
 
2:51 AM
whatever should be something like alias<CommonType(void*)>*.
 
@LucDanton Shouldn't that be static_cast<std::tuple<Types...>*>?
 
Yup. Which in this case means you only really needs the indices, too. Indices really are versatile when it comes to variadics.
 
welp, C++14 has a Standard class for that.
 
integer_sequence got accepted?
 
yep.
 
2:55 AM
Interesting.
 
yours truly was one of the ones in the room who voted it in (although basically nobody voted against, so...)
 
    template<typename Tuple>
    static Element do_front(int current, Tuple& tuple, indices<I>)
    { return range::front(adl::get<I>(tuple)); }

    template<typename Tuple, int I, int... Is>
    static Element do_front(int current, Tuple& tuple, indices<I, Is...>)
    {
        if(current == I) return range::front(adl::get<I>(tuple));
        else return do_front(current + 1, tuple, indices<Is...> {});
    }
^ this is the ugliness I have to put up with instead.
 
Wonder what header it'll be in
Its own?
 
i.e. unrolling a 'variadic' case statement by hand.
 
I... think it might have been <utility> or <tuple>?
don't know.
@LucDanton So the giant if/else chain?
 
2:59 AM
3 mins ago, by Luc Danton
i.e. unrolling a 'variadic' case statement by hand.
 
I can see that being more efficient than the function pointer dispatch for low numbers of N.
 
Or cond-statement, pick your poison :p
 
the compiler can convert it to a jump table.
 

« first day (1035 days earlier)      last day (3928 days later) »