« first day (526 days earlier)      last day (4647 days later) » 

00:00
of course, you call the sort function at compile-time and the returned function at run-time, which is hilarities, but not fundamentally equivalence-breaking
if it's a member template it can be type X(type T(type U)) { return type X(type T) { return class { ... }; }
@CatPlusPlus You don't have to do it explicitly.
@FredOverflow Truthfully, I keep changing the syntax, cause I need to add some more keywords :P
which is why the spec says that a template specialization is either a class, function or a class member
00:01
And you don't want any Wide code to leak until the syntax is fixed? :)
mmm
more like, I keep forgetting and half the sample is written in the last version and half the sample is in the new version and it doesn't make sense when you put it together :P
especially since I haven't finalized any of my library design yet
Why don't you call your language "narrow" as long as it's in beta. You can even abbreviate it with n=> :)
lol
Wide usually equals to boring
why haven't you called it Tight
tight like a duck's behind!
00:02
or both of them. Wight xD
lol
warrow like an arrow
You can ask Jack Sparrow to endorse Narrow.
N-arrrrr-ow!
i have this idea: a keyword to request immediate instantiation of all templates comprising a dependent name
00:05
call it litb
"identity<T>::now type" would mean "instantiate identity<T> NOW, and then yield its 'type' nested member"
it would allow to have an IMO useful mix of alias templates and class templates
template<typename T> void f(add_rvalue_reference<T>::now type t);
What if T isn't known yet? Or is that a nonsense question?
would be equivalent to
template<typename T> void f(T &&t);
@FredOverflow it is known. it is a template type parameter
I don't see what that now type brings to the table.
@FredOverflow it allows to work with dependent types
rather than only with the types that exist at instantiation
00:08
Wide doesn't have dependent or incomplete types- whew
So instead of prefix typename you say postfix now? :)
for example "T::now foo" is ill-formed, because a template type parameter is not a class or enumeration type
so it cannot be used as a scope specifier
@DeadMG I don't believe in the theory behind it, the infinite-parallelism. After all, nobody's made it work for any problem that couldn't be solved on a 4004 based calculator. That one was 4-bit.
@FredOverflow I intentionally do not make "now" a prefix keyword. but i make it like "::template"
@CheersandhthAlf The algorithm works. You can simulate it on a classical computer with enough memory. A quantum computer is just a "native" implementation, as it were.
00:09
I still don't get it. Sorry, have been doing Java all day, my TQ (template quotient) has dropped dramatically.
that has the benefit that you can precisely say up to what level you want to immediately look into. for example is_lvalue_reference<add_rvalue_reference<T>::now type>::value
notice that i did not put "now" before "value"
if i would have done so, we would immediately receive "false"
Yes, I agree that the algorithm works. I just don't believe in the fancy Everett interpretation of quantum physics, where each little planc time produces a near infinite branching of correlated universes. It's a bit too silly.
because "T&&" is not an lvalue reference
00:10
And without the machinery, what helps if the algorithm works?
but since i did not prefix "value" with "now", we wait until instantiation for the dependent name, and then when we substitute an lvalue ref for T in "T&&" , we will get "true"
Wait until instantiation? So now works before instantiation? But then T isn't known, is it?
T is known. it is a type parameter.if it is "template<typename T>", then it is the first type parameter in its template parameter list
But you only know what T is when you instantiate the template.
@CheersandhthAlf The whole of quantum physics is absurdly silly. Firstly, the many-worlds interpretation is just one, but secondly, I don't find it any more unintuitive than things like the Heisenberg Uncertainty Principle
00:13
So I still don't see the difference between now and not now :)
the type identity when instantiating just changes from "type-parameter-1-1" (depth 1, position 1) to "whatevertypewasusedwheninstantiating"
@DeadMG yes, i very agree :-)
@FredOverflow substituting immediately, like alias templates do, prevents non-deduced contexts
but since we will be based on the usual specialization mechanism, we have explicit specializations available.
Although Heisenberg's principle follows from a bit of math.
@JohannesSchaublitb Sorry, but that's pure gibberish to my Java-retarded brain. Thanks for trying, though.
00:15
@FredOverflow for example:
wait, it's going to be bigger
Okay, I understand so far :)
The Intel 4004 was a 4-bit central processing unit (CPU) released by Intel Corporation in 1971. It was the first complete CPU on one chip, and also the first commercially available microprocessor. Such a feat of integration was made possible by the use of then-new silicon gate technology allowing a higher number of transistors and a faster speed than was possible before. History and production The first public mention of 4004 was an advertisement in the November 15, 1971 edition of Electronic News, though unconfirmed reports put the date of first delivery as early as March 1971. Pa...
@FredOverflow ^^
this is an example for working with dependent types
pattern<_1(_2**)>::match<int*(bool**)>::value == true
pattern<void(_1::*)(_1*, _2)>::match<void(C::*)(C*, int)>::value == true
Why all the pointers?
note that the "T" needs to be a parameter of the outer template, so that it is already resolved (at instantiation) when we early-on resolve the dependent name used in the argument of the partial specialization.
that code can only match patterns with 2 placeholders
00:30
Anyway, gotta hit the hay. Good night, guys!
because if the pattern does not contain either _1 or _2, then either A or B cannot be deduced for the partial specialization and it will never be selected
@FredOverflow does it make sense?
i wonder whether i should make a proposal for wg21 about it
@CheersandhthAlf What does the "diamond"-operator do?
@StackedCrooked Huh? If <>, in Pascal that was "not equal" or "different from"?
Or in C++, template<> is complete specialization
@CheersandhthAlf I mean on the picture of the Intel 4004. Above the division operator button.
I am not sure, but some quick googling indicates that it's a modifier key, i.e. changes meaning of other keys.
01:06
@AlexDan huh, 600851475143 isn't very big? Compared to e.g. the foreign debt of the USA?
$15,584,905,894,127 and some cents, according to the US guvmint
0
Q: Why do I have to overload operator== in POD types?

K.G.I have a struct that's defined like this: struct Vec3 { float x, y, z; } When I attempted to use std::unique on a std::vector<Vec3>, I was met with this error: Description Resource Path Location Type no match for ‘operator==’ in ‘_first._gnu_cxx::__normal_iterator<_It...

01:22
I think two PODs are equal only if their binary representations are equal.
In which case the compiler could provide a default implementation.
But just because it could do it doesn't mean that it is a good idea :D
std::vector<bool> because we can.
:D
01:51
0
A: Why do I have to overload operator== in POD types?

Cheers and hth. - AlfThe question of why you have to provide operator== is not the same as the question of why you have to provide some comparison function. Regarding the latter, the reason that you are required to provide the comparison logic, is that element-wise equality is seldom appropriate. Consider, for examp...

^ I answered a question, yay!
I need to block a bunch of websites
distracting me too much from work :P
There is that xkcd trick where you introduce a 30 second delay for loading certain website.
I've actually got no idea how to make that happen
See the alt text.
02:00
yeah
but I've no idea how to make it happen for me :P
There's even a chrome app :D
There are a few blog posts than explain how you can do this.
ok
win
aargh
I went to Cracked to block it, and now I'm trapped there
02:23
ok
now I blocked virtually every website I visit except the stack exchange sites :P
Project Euler is kind of fun.
eh
I've already got more than enough code that needs writing
I'm still working on the STM port of my Tetris app.
sounds like funsies
02:38
It's kind of a mindfuck in the beginning.
I have this big program that is written in lock-based code and now I have to make it STM.
Took me a few weeks just to find some sort of starting point :)
Since I only work on it in the weekends, sometimes.
A frequent problem is that not all resources are memory. Locks can protect both memory and non-memory resources (e.g. log stream) in the same scope. STM only deals with memory. Furthermore, since transactions can be retried, the non-memory resources should not be accessed from inside the transactions. (Perhaps this is OK for transactions that only do reading.)
so... STM is like a GC, then
only handles memory, and you can't handle non-memory resources in code that uses it
Yeah, kind of.
My workarounds that usually involve local variables.
I declare the local variable outside of the transaction. Write to it inside the transaction. And then use it after the transaction.
Kind of messy.
yeah
that doesn't sound like a ton of hilarities
right
02:47
Part of the process is looking for ways to use it.
now the only errors I have are in my Direct3D9 render implementation, and in the main() file
I need to add new capabilities to the OS interface so it can find all unit files, then add the Sim and UI contexts and make them work
and also implement a whole shiatbunch of UI functionality
What are you making again?
a game
right
so the next step right now is to fix my 3D rendering interface
no point having a simulation interface if no 3D rendering interface, amirite?
Probably.
right
well, first thing to do is cut storing all the vertexes in the same vertex buffer
only do that compacting thing if it turns out to be actually necessary
also, if feeling ballsy, write gpu_buffer<T> class
actually, just do that anyway
02:54
So typical to love writing abstraction and hate writing application.
rofl
here's a question
for a resource class X, and a class Y which depends on resource X, should I just make it UB to delete X before Y?
Xeo
Xeo
Why don't you tie X's lifetime to Y?
yeah
that's what I've been doing previous to now
02:58
I'm close to finishing random name/universe generation for my new 'game' in python :D
actually, my intended use case was really YAGNI anyway, so
@DeadMG Reminds me of a question I posted last week :p
oh cocksickles
But probably not the same use case.
Xeo
Xeo
When I do resource management in games, I always just load all resources for a scene and hand out read-only refs.
But maybe that's because the scenes tend to be small
even for the Wii I could do that

« first day (526 days earlier)      last day (4647 days later) »