« first day (236 days earlier)      last day (4705 days later) » 

12:00 AM
@Xeo Magic.
 
Mathemagic.
 
those people who do this stuff are Mathemagicians™
but at least I feel more confident
 
> So if call sort with a std::list I will get a horrible template error.
 
Xeo
What is the ASCII code for TM anyways?
lol
 
12:04 AM
there isn't one
 
Xeo
Where did you find that?
 
it's \u0153
 
log(ℵ_1) = ℵ_0
On Macintosh™ it's option-2
 
I type Alt+0153 on Windows.
 
@Xeo None, it might be in some of the CPs though.
 
12:05 AM
@Xeo charmap
 
If only everyone stuck to the Unicode.
 
Or google.
Sometimes I raid wikipedia just to grab special symbols :) (like )
 
Figures an Apple would have ™ on speed dial.
 
@cHao HTML entities don't work here :( They do work on the main site though :)
 
Unicode Character 'TRADE MARK SIGN' (U+2122)
 
12:08 AM
alt-2122 just gives a J
 
@DeadMG it truncated the codepoint
 
I long ago stopped trying to understand how the Windows Alt sequences work.
 
2122 & 7F = 4A
 
Why was the modules proposal dropped?
 
because there were no known implementations, which means no known performance or other problems
and secondly, because of templates- implementing templates in modules basically sums to implementing export
 
12:11 AM
Oh that :(
 
Heh, performance. I doubt that can get any worse.
 
well, in theory, modules would be significantly more performant than the existing ystem
no endless reparsing of the same files over and over
 
And less fucking preprocessor.
 
effectively, I think that modules can't be bolted-on to how things are now- we'd have to cut the entire existing system
which is fine by me
I don't see why they don't, instead, just cut all of the declaration and definition order requirements
and all their associated wordings
 
The latest proposal had something about integrating with current headers.
AFAIR
Backwards compatibility?
 
12:13 AM
yeah- you could encapsulate the include as something that's private to the module, so no macro leakage or anything like that, but you could still use macros from headers
but you'd only be relaxing the rules
just like how we relaxed the rules on unions
 
Oh, right. It's a bit late, and I'm writing assembler. I might ramble incoherently.
 
@DeadMG Because there's the risk that everyone just ignores that hypothetical Standard and doesn't implement it
 
And by a bit late I mean 2AM.
 
@LucDanton: True, true- but the same risk is taken with modules
because fundamentally, they're damn right- implementing templates in modules is implementing export
so either you implement export, you don't implement anything, or you fundamentally change the system
 
For this kind of things they're likely to go with a TR
 
Xeo
12:15 AM
@MartinhoFernandes Watch the starred Q&A with Herb, it's mentioned there
 
Eh, multiplication of sparse matrices. So tedious to write.
 
@Xeo I'm still working through sbi's salvage post of Fred's question. I'm watching STL right now.
 
Xeo
@MartinhoFernandes Which post?
 
honestly, I found STL's series somewhat disappointing
 
12:17 AM
@CatPlusPlus Cmon! Sparse matrix multiplication is the shiznit!
 
it didn't really cover that much
 
Do the tridiagonal shuffle…
 
Xeo
@MartinhoFernandes Ah
 
especially the fifth part, which was about Boost, and I'm like, well, I clicked the link to read about libraries in the Standard
 
Xeo
@DeadMG Maybe you just know too much already
 
12:17 AM
yeah
there is that distinct possibility
 
@Potatoswatter In assembly.
MIPS assembly, to be precise.
 
Xeo
But y'know, while we're on the matter of knowing too much, I like my learning curve with C++.
Started 1 1/2 years ago
 
@CatPlusPlus MIPS is awesome! I worked on a MIPS datapath!
 
Xeo
You guys should move to another room. Assembly is considered too low in here.
 
… seriously, do you really want to be writing Cell assembly instead?
 
12:21 AM
No. :P
 
lol
@Xeo: Same here, actually
 
Xeo
I wonder if people turn away from upvoting this because it's a quote from the standard. :(
 
They're onto your badge scheme.
 
Xeo
D:
I fear that
 
Well, firstly, the answer doesn't give any summary or anything
 
12:23 AM
Maybe because they prefer English to standardese. Or English & Standardese.
 
it's just "read this wall of text"
secondly, it's late and there's not many users on
 
Xeo
Hm, but I highlighted the interesting part!
But good point
 
thirdly, you got ninjaed by a much more readable answer by GMan
 
English & Standardese would yield just a bunch of 'the's.
 
?
Oh, bitwise and.
Wordwise and.
 
12:25 AM
Did you know: Trainwise and is a mess to clean up.
 
Man get off that assembly.
 
No, sorry, my brain is on assembly right now.
 
@CatPlusPlus What does that mean?
 
Xeo
@DeadMG I think I need to memorize the standard so I can one-shot all those questions.
 
@MartinhoFernandes Hell if I know.
 
12:26 AM
@Xeo: You'd get more points for a quick summary
 
I think it would work better with 'or'.
 
people don't normally want or ask for Standard quotes, they want an answer
 
Because trains shouldn't be or'd together.
 
Xeo
Well, it is an answer. I even highlighted it! But I get your point
 
@DeadMG Some of us here aren't normal ;v)
 
12:27 AM
I got it. You were trying to invoke a trainwreck.
Again, I think you should get off whatever you're hooked on.
 
I can't RISC it.
 
then CISC it- go x86
 
Somehow, I don't think that would help. :P
 
How much do you have to do in assembly? Is this practical, academic, or just self-torture?
 
Academic. I'm not that insane to write assembly for myself.
 
12:30 AM
So there's a limit to his insanity.
 
Xeo
@CatPlusPlus I am, but only to cheat the C++ type system
 
you don't need assembly for that
 
Have you tried telling the prof that there's no reason to learn how to write anything except inner loops?
 
a good dose of reinterpret-cast or some unions will handily subvert whatever you have in mind
 
Xeo
@DeadMG But it certainly makes it easier.
2 lines in assembly vs 200 lines in C++ to implement a delegate.
That handles functors, free- and memberfunctions. Even lambdas.
 
12:31 AM
@Potatoswatter Well, it's a course on Computer Systems Architecture.
Or whatever the proper translation is. Something like that.
 
@CatPlusPlus Of the two courses I took along those lines, one was 8086 assembly and we wrote little games,
and for the other, we were given assembly code and designed the microprocessor to run it.
 
Gosh, we never worked with more than 10 lines of code in those classes.
 
I wrote a cross-compiler in LLVM to a custom instruction set, which meant a double helping of asm…
 
@MartinhoFernandes It's converging to Fridays.
 
I'm off to bed. Good night.
 
12:35 AM
Oh, Computer Architecture and Organization is the official name, I think.
 
but still didn't directly write any. Anhoo, the prof might take constructive criticism well. It really depends, lol!
@CatPlusPlus Yeah, that's roughly the same title as the one at my school where we wrote verilog.
 
We did logic circuits in the first part of the semester.
 
courses.engr.illinois.edu/ece411 Computer Organization and Design - these things are standardized by ABET
 
except C++'s std::function is value-typed
 
Xeo
@DeadMG That line is an answer to what?
 
12:42 AM
not completely sure
but std::function does an awful lot more than just call a delegate
it maintains value semantics, has heap allocation, that sort of thing
 
Xeo
@DeadMG Not really, it is designed to be a delegate.
 
your assembly will never be cross-platform, it will never retain value semantics
 
Xeo
What it does internally doesn't really matter
 
what's the copy constructor of two lines of assembly- oh wait
 
Xeo
@DeadMG the copy of a void* and a void (*)()
 
12:43 AM
besides, I certainly don't believe that you can write assembly as generic as the C++ written in 2 lines
 
Xeo
the assembly only uses those two
 
yeah, but that doesn't retain value semantics
you're just hoping that the pointer stays valid
 
@Xeo: OK, I have to ask. What does a disembodied jump instruction get you that proper use of void(*)() doesn't?
 
Xeo
If I take a pointer into the delegate, I heap-allocate a new function
@Potatoswatter The signature is irrelevant for the call
 
ok
so what's going to stop me from mis-using it in a type-unsafe way?
 
12:45 AM
Except it will crash if you try a function with the wrong signature…
 
Calling member function via assembly is dangerous.
 
I hope it wasn't virtual
 
i.e., needing any kind of argument whatsoever. Or a return value that isn't one machine register. So you're essentially stuck with void(*)().
 
Xeo
@DeadMG That's the only problem I'm still having. virtual :|
 
The calling conventions for C++ differ from compiler to compiler even on the same platform.
 
12:46 AM
so actually, you don't at all have assembly capable of anything near as useful as std::function
 
Xeo
@CatPlusPlus MSVC uses edx to pass this, GCC does it as the first parameter
@DeadMG I'll get there, but it's way shorter.
 
no, I really don't think it will be
 
It will get unmaintainable fast.
 
Xeo
@Potatoswatter You can't call a wrong function, because the delegate itself is templated
 
unless you plan on calling new from assembly, or checking the types there, you're still going to need the vast, vast majority of the same code
all that you might ever achieve is replacing one line of C++, the actual call itself, with two lines of assembly
 
Xeo
12:48 AM
Guys
 
oh, and I hope you had no plans for implicit conversions either
 
Xeo
Not the whole delegate is written in assembly...
Only the operator()
 
right
so you're replacing operator(), which is going to be return inner_ptr->call(...); with assembly
saving yourself... well... nothing
 
Assembly syntax also differs from compiler to compiler. :P
 
Xeo
@DeadMG Did you take a look at boost::/std::function? It's far from that
 
12:49 AM
yeah, but the rest is quite optional
 
Oh, right, I was supposed to be working. I should really be sleeping now, dammit.
 
Xeo
@CatPlusPlus Reminds me, I need to continue on that shader exam
 
MSVC's std::function implementation is quite unreadable
thanks to the mass of macros they used to emulate variadic templates
 
Xeo
@DeadMG Boost isn't any better
 
wow, no way
I actually see
 
12:54 AM
time and parameter packs heal all…
 
return (_Callee.template _ApplyX<_Rx>(_A0_A1));
in the STL implementation
I thought MSVC barfed on that?
wow
apparently not anymore
it'll still compile without it, but at least it doesn't throw an error
 
0
Q: Why are there so many accomplished Scandinavian programmers?

SteveMost of the inventors of major programming languages were either Danish, Swedish, or Norwegian, and they all have a lot of eminence in the field. Is there a historical or economic significance to this, or merely a very strange coincidence? Not that this is a good or bad thing, except I'm just re...

Lol.
And , no less.
 
bugger, no template typedef
 
1:10 AM
@DeadMG huh? wrap it in a class
 
yeah, don't need it anyway ;p
lols, can't get my home-rolled function class to construct from a function pointer
I mean, do function pointers not get perfectly forwarded or something?
 
There should be no reason to be treating it as anything but an rvalue. What's the issue?
 
Xeo
@DeadMG Do pointers even need perfect forwarding?
 
dunno, MSVC throws, saying itcan't convert void(*)() to void(&&)()
 
Xeo
@DeadMG Well, obviously. You want a function rvalue ref, which doesn't exist. How did you get that type anyways?
 
1:19 AM
template<typename T> constructor(T&&)
 
Xeo
Called with?
 
void f() {} int main() { type val(f); }
 
Aesthetically I prefer function references to function pointers, but the decay rules make pointers more practical. Function rvalue references are just nuts.
 
Xeo
@DeadMG Well, yeah, that function isn't a temporary. There are no temporary functions after all
 
@DeadMG Try explicitly writing &f. That looks like a surprising compiler bug.
 
Xeo
1:22 AM
But it's strange that it doesn't deduce the template parameter as a function pointer
 
@PotatoSwatter: The type is the type of my function object, where the posted constructor is being called
 
@DeadMG Sorry, false MVP alarm :P
 
lol
I did indeed try &f explicitly
but it wouldn't take it
I figure that, in perfect forwarding, then T becomes a reference, if it's a non-const lvalue
so std::decay<T>::type should produce the value type
 
Xeo
@Potatoswatter , @DeadMG ideone.com/KhWYQ
 
1:37 AM
maybe it's a problem in std::decay?
 
@DeadMG I regularly pass functions to perfectly forwarding functions/constructors in tandem with std::decay and it works as specified
 
Xeo
@DeadMG Add the includes please. :|
 
yeah, and I fixed a couple other bugs that MSVC is lenient on
 
Xeo
Forgot the template before Derived
 
1:47 AM
which is fair enough, MSVC doesn't care though
oh
it's because (*this) isn't const
and the template constructor is a better match
result: success
 
Gawd, over 400 lines of code and I still haven't started the multiplication itself.
 
see, I'm sure that MSVC was bitching about the constructor line
anyway
fixed'ski
 
@CatPlusPlus sparse matrices tend to be structure-intensive. Why the fuck is he asking you to write such a serious program?
Also, that won't exercise the CPU… our test program consisted of a random web of traps, indirect branches, and cache-thrashing memory access patterns.
 
@Potatoswatter Dunno. But I already got max. points by accident, so it wouldn't be nice to not write it. :P
 
Is struct base { virtual ~base() = default; }; struct derived: base { ~derived() = default; }; supposed to work? GCC says it's not and I'm having a hard time tracking the relevant parts in n3242.
 
1:53 AM
pretty sure that default is valid for any member function which might be implicitly generated
which includes the destructor
 
In this case the problem is that ~base is noexcept and ~derived isn't according to GCC.
 
Xeo
@LucDanton What? Why is ~base noexcept?
 
@LucDanton That's what I'm seeing on recent GCC 4.7…
 
@Xeo The new behaviour is that default destructor are noexcept most of the time
 
it compiles fine if ~derived is marked noexcept manually.
 
1:55 AM
I'm trying to find the details to better understand this
@Potatoswatter In my concrete case I get a further error because my declaration (with noexcept) doesn't match the implicit declaration, which is needed to default the destructor in the first declaration.
So now I'm looking why my destructor is marked noexcept(false)
 

« first day (236 days earlier)      last day (4705 days later) »