« first day (1448 days earlier)      last day (3483 days later) » 

12:01 AM
what do you think of the categorisation above?
finicky?
 
No likey.
Above all, I think ‘(meta)function’ should remain a catch-all term that includes everything.
 
@LucDanton por que
 
We’ve used the argument ‘this computes X, so it shouldn’t be called a trait’ more than once.
But it’s all (meta)computations.
 
Ell
What is the stuff called in mathematics?
 
I think when we bring up those arguments we’re thinking ‘it does compute something, but it does not compute what a trait does, so it’s not one’. We’re still trying to find and define that missing piece, so that makes it hard to talk about it (aside from fuzzy feeling).
 
Ell
12:03 AM
I guess assertions
 
iunno
hm
I guess if we generalise it enough
I could say a type trait is just something that queries any relation regarding a type.
so is_convertible would be a trait of the type
is_const, is_void, is_whatever?
yeah sure there are computations behind the scenes
but at the end of the day you're asking if the type does or is something
that's what a type trait is to me
the rest are (meta)functions
 
Cmon
 
:(
what?
 
bool even(int n) { return (n % 2) == 0; } is a function.
Queries and non-query (meta)functions, fine. But queries and (meta)functions, implying that queries aren’t, no.
 
traits are a subset of metafunctions :v
they're still metafunctions
 
12:08 AM
1 min ago, by Rapptz
the rest are (meta)functions
Objecting to that in particular
 
well I don't know what else to call them
 
So std::remove_extent (def. not a query) is not a trait then?
 
not imo, no.
it's not asking what a type does or is.
that's just how I see it though
it makes sense to me at least
 
What if remove_reference was called referend, and remove_extent array_element_type?
(or rather referee?)
 
lol never seen traits named like that before
:p
but hypothetically speaking in my mind they change meaning
I'm no longer thinking of the computation done on the type.
 
12:13 AM
I still abide by my two-axes view: queries and non-queries, properties of/relations on a type or types and… the rest (another hole, heh).
 
well
what do you consider 'remove_extend'?
 
Typelist ops clearly an example of ‘rest’.
 
a query? a property?
 
Non-query property/relation.
Err query might just be the wrong word.
I wanted something to mean ‘maps to bool’ so… predicates and non-predicates (procedures?).
Non-predicate relation.
 
oh..
you know
rather than dealing with whatever something is a trait or whatever
wouldn't it just be better to think about what it 'returns' instead?
 
12:17 AM
In a logical programming language you go element_type(Array, e) or element_type(Array, Element) depending on if you want the value of the relation, or find out which e.g. element type is in the relation :Þ
@Rapptz That’s what I’ve been doing for a half of it.
Badly, since I apparently completely overlooked the actual meaning of ‘query’ :(
 
so like
 
Doing it right… (meta)predicates and (meta)procedures don’t sound so bad.
Obviously there will be the round of confusion of ‘but C++ metaprogramming is pure, what procedures are you talking about!’, so let’s call it a WIP.
 
I don't really like predicates
it's overloaded
badly so
names feel very WIP to me :v
 
@Rapptz Is it?
 
but essentially I guess there are 'things that return ::type' and 'things that return ::value'?
 
12:22 AM
Nah, consider e.g. tuple_size. That’s non-type vs type. And we love non-type types (aka std::integral_constant), to muddy it up.
 
@LucDanton Well, I mean. Consider is_binary_predicate. Binary function that returns bool or a 'metafunction' that takes two types and returns ::value?
 
is_binary_metapredicate
Same answer as the same question, but with (meta)functions. Your move!
 
Wait, what's wrong with tuple_size?
 
@Rapptz It can give a value. Not a predicate.
int main(); is not a predicate :Þ
 
yeah I know
that's why I don't like the term 'predicate'
iunno everything feels weird
I realised std::integral_constant decided to have a ::type right there
like, shit
why?
SFINAE?
not that I care too much or anything, I'm just surprised I never noticed until now
 
12:26 AM
@Rapptz Ye. You can eval metapredicates in struct foo<T, eval_t<pred<T>>> and match foo<T, std::true_type>.
I do it regularly. Not my favourite brand of SFINAE, but sometimes it’s the lesser evil.
 
so metafunctions (things that return "type" or "value") and metapredicates, a subset of metafunction that return std::true_type or std::false_type?
 
Ye. Actually I tend to pretend metafunctions only produce a type.
 
what do you call the subset that returns ::type?
@LucDanton So what about things that compute things like tuple_size?
 
My own tuple_size computes a (type-level) integral constant. Think MPL.
I suppose…
 
never used MPL
 
12:30 AM
I do work with the rule of thumb that ‘if it computes an IC, it has a value’.
 
well, yeah
 
So I never go eval_t<foo>::value. Always foo::value.
 
yes
 
Ell
Isn't doing ::type like evaluating the metafunction?
 
It is.
 
Ell
12:33 AM
Which metafunctions "return ::type"?
 
yeah but you don't have to do eval<T>::value
technically all of them
 
Instantiating it and using it is considered evaluating. How you use it (access ::type, access ::value, or more) is convention-dependent.
 
because std::integral_constant has a type typedef
 
@Rapptz That’s not it.
 
never used MPL, sorry
 
12:33 AM
Consider struct zero { using type = meta::int_<0>; };
 
what's int_?
 
Alias to std::integral_constant<int, N>.
 
lol
 
Contrast with struct zero: meta::int_<0> {};
 
Ell
Hmm. What is inheritance in metaprogramming terms? If a class is a metafunction?
 
12:36 AM
There have been times where I had to add a static constexpr auto value = …; because I was defining just the type, and I pervasively rely on the convention that ‘if it computes an integral constant, it has a ::value’.
@Ell It’s like an equals sign (at least for single inheritance).
Compare template<…args…> struct foo: bar<…args…> {}; and template<…args…> using foo = bar<…args…>;. They’re equivalent.
 
Ell
Oh yeah
 
So what do you call things that return ::type?
 
(Meta)functions.
 
What about ::value?
 
It’s available to IC-producing functions as a convenience.
 
12:39 AM
:(
no fun
brb MPL docs
 
Ell
Which things return a ::value?
 
Functions returning an std::integral_constant<T, N>.
 
Ell
Shouldn't all templates just return a type for consistency? And its down to the "caller" to ::type or ::value ?
 
I don’t follow. What kind of templates?
 
Ell
Well. They do. I'm getting confusedv
Ignore me, classes can't return values :P
 
12:42 AM
Function templates.
 
Ell
Yeah
But we are talking metafunctions, which must be classes right?
 
@LucDanton I don't really like this
 
Ell
Because a function template can't return a type
 
Why can't classes return values?
 
@Ell Constant metafunctions don’t have to be class templates though. See above zero example. Not the norm of course, but it happens.
 
12:44 AM
In my eyes there has to be a difference between things that return integral constant expressions and things that have a type typedef
 
Metavariables, I guess :)
@Rapptz Hang on.
I made sure to say ‘IC’, not ‘ICE’.
 
?
 
By which I really mean std::integral_constant<T, N>. I don’t use an IC concept like MPL.
@Rapptz It’s all about computing types. There are no expressions.
foo::value being a convenience for eval_t<foo>::value where foo yields an IC.
 
okay
by ICE I meant std::integral_constant
I still think in my eyes that there has to be a difference
 
Well the difference is that the type computed is an IC specialization, where for the others it is not.
 
12:46 AM
iunno, still don't like it
 
I sometimes have things that produce a type that has a ::value that’s something else altogether. That’s me using the resulting type, nothing to do with what’s producing it.
What do you call (value-level) functions that return numeric (integral?) values that you don’t call the others?
 
?
example?
 
What do you call int foo(…args…); that you don’t std::string qux(…args…);?
 
iunno
not enough context
depends on the 'interface'
 
That’s all the difference there is.
 
12:52 AM
like for example I'd call something that provides void draw(args...) to be 'drawable' but if it provides int f(args...) then it isn't what I'd call 'drawable'
 
My point being that you don’t have to trait type-level functions that differently from value-level functions.
@Rapptz What?
What do you mean, ‘provides’?
 
like
 
I’m talking about plain functions.
 
meh
what I'm saying is
I have a massive major piece of the puzzle in my mind missing here
like
struct test { using type = int; }; vs struct other { static constexpr size_t value = 10; };
 
I simply don’t use the latter.
 
12:54 AM
sure
but they're there
 
Well, no. Since I don’t use them.
 
and idk how you categorise them
I know :(
but that suddenly doesn't exclude them from actually being viable metafunctions
I don't think there's a pre-requisite that foo<T>::value has to be equivalent to eval<foo<T>>::value
 
It’s not about who’s a metafunction or not, it’s about convention.
I put all results into ::type, for consistency.
 
well, this is what's missing for me
 
@Rapptz It’s an accident (from inheriting in the implementations).
 
12:56 AM
yeah, and user bob doesn't have to do that
 
Ell
@lucdanton this is what I was trying to say earlier but I couldn't express it
 
@Rapptz std::iterator_traits and the like compute tons of stuff in one go.
 
my point was
what would you call the latter?
 
@Rapptz Okay: it’s something that stems from an accident, but that I’ve consistently have been using since.
 
because I don't know
 
12:57 AM
@Rapptz Latter of which?
 
the other struct
 
21 mins ago, by Luc Danton
There have been times where I had to add a static constexpr auto value = …; because I was defining just the type, and I pervasively rely on the convention that ‘if it computes an integral constant, it has a ::value’.
^me being consistent
@Rapptz dunno, I’m not the writer and I don’t know what is intended
(I don’t mean that unkindly.)
It’s the cost of the silliness of C++ metaprogramming, which is for the most part untyped (unkinded).
A metafunction is a type that puts its results in ::type <- is just one convention amongst many
The ‘function’ part is that there is an output that depends on the inputs. That’s it.
If you compute a ::value and put it there, you might very well have a function with another convention/interface.
I suppose you’re concerned about things that compute both a type and value, which meanings need not be tied. I can’t tell you what they are. I have some of those things, and I don’t call them functions because they’re really holders of a value (and type is a convenience alias). Not anymore than std::string::npos means std::basic_string is a metafunction.
It might be two functions fused at the hip.
 
My issue stems from actual categorisation of things that return ::type vs ::value vs both
 
That’s the extent of how I can help you :) You’re the one that wants them, you’re the one to name them.
I mean to convey that you’re the one taking charge of the convention here.
 
If you're just after a general taxonomy, whatever ::value's are, they are things that can be used as template parameters--so they still fit in the potential domain of potential meta-functions
You might want to slice it up based on intent, or just lump it all together
I usually don't interfere with these discussions... don't want to input, and find it fascinating on its own
 
1:05 AM
@HWalters You’re assuming things.
 
So..
What is an ICE?
 
Integral constant expression?
 
Quite the opposite... I'm trying to eliminate assumptions
 
yeah
 
int a[/* ICE goes here */];
 
1:06 AM
Is std::integral_constant<size_t, sizeof...(Args)> an ICE?
 
@Rapptz Internal Compiler Error on MSVC. :)
Good morning.
 
I'm not sure what the actual goal is, but it would have to be decided based on some convention
 
@HWalters My whole point was that you could decide to use things like struct wat { static int value; };, in which case no, you cannot use that as an integral template argument.
@Rapptz No, it’s a type.
 
I see.
What if you use ::value?
ICE then right?
(n.b.: I know the standard definition)
 
I only use it for that member of std::integral_constant, which it is.
 
1:09 AM
just so you don't think I'm retarded or anything :v
for asking silly questions
 
It’s fine.
 
Luc: Sure, I guess you could make value's that aren't IC's, so in that case I'm assuming value's an IC (for that matter, you could make ::type's that aren't types)
 
@HWalters Exactly.
 
Well.
 
In contrast MPL has a whole IntegralConstant concept, so there’s more than just the specializations of boost::integral_constant.
So, what do you intend to use ::value for?
 
1:12 AM
Me?
 
Ye.
 
storing a compile-time value
 
Hey, that’s a name: stores!
 
lol
I gave up on the whole category thing
I just have these
Metafunction -> Returns ::type and/or ::value
Metapredicate -> Returns std::true_type or std::false_type
Integral constants -> Things that return ::value
 
Before decltype it was useful for MPL-style ICs to not just have the ::value, else you couldn’t e.g. put it in a variable of the appropriate type.
 
1:17 AM
FWIW, the reason why I was hellbent on the whole category thing is because I needed a way to create 'metafunctions' for these
and still do
 
user3010322
I
 
user3010322
HATE
 
user3010322
MSVC. ._.
 
k I’m done renaming meta.hpp I think I’m going to call it a night.
 
MICROSOFT SOFTWARE VERY CRUDE
@LucDanton Good night.
 
1:19 AM
nn
 
user3010322
I want to switch to MinGW so bad.
 
user3010322
But DirectX keeps borking on me.
 
user3010322
;~;
 
user3010322
y u do dis DirectX
 
lrn2opengl
 
user3010322
1:20 AM
YOU learn to OpenGL. D:<
 
@ThePhD Wait. It must be MinGW's fault with how they "interface" DX.
 
@Rapptz I suppose in my case that would be equivalent to querying (using the term right this time) the kind of the return type :)
 
yea
but I need names for said traits/metafunctions :v
 
Maybe the DX stuff in MinGW are just buggy because of the lack of usage.
 
I’m not sure what’s the sort of a metametafunction that tells k -> * apart from k -> 'Bool from k -> 'Nat ;) Perhaps s -> ''Classification?
 
user3010322
1:24 AM
@MarkGarcia Probably.
 
@LucDanton I could do is_integral_constant for things that return ::value
and is_metafunction for things that do ::value or ::type
but what would I call ::type? :v
 
user3010322
is_transform ?
 
Hm. It would be interesting if someone could do a mechanical transformation of MSVC DX files into MinGW compatible ones.
 
user3010322
Someone does that for DirectX -> C#
 
user3010322
Maybe the same technique could be used for MinGW.
 
user3010322
1:28 AM
... Or we could just use OpenGL and forget all the bullshit.
 
user3010322
THAT'S A THING TOO.
 
user3010322
How can MSVC's operator lookup be so TREMENDOUSLY retarded?
 
user3010322
half operator+(half, float)
expression operator+( symbol, ArithmeticType );
 
user3010322
HOW does DOUBLE, which is NOT a good conversion to float, plus a variable type, which looks NOTHING like half,
 
user3010322
and has no implicit conversions that would WORK with half,
 
user3010322
1:31 AM
make the half operator+ a GOOD CHOICE?
 
user3010322
HOW DO YOU DO THIS BULLSHIT VC++?
 
user3010322
It wouldn't even make it to the half overload because there's NO CONVERSIONS for which it would be acceptable.
 
user3010322
HOW DO YOU SHIP A COMPILER LIKE THIS.
 
user3010322
HOW DO YOU SHIP SUCH BROKEN PRODUCT AND STILL MAKE MONEY
 
user3010322
WHY DO I LIVE IN A TIME SUCH A THIS.
 
1:34 AM
@ThePhD worked for borland for years
 
user3010322
@Mgetz These companies deserve to have their profits gutted and dropped into a deep abyss, which has them falling while chained to a computer where every single moment of their unsleeping eternity they must fight with their own Internal Compiler Errors.
 
user3010322
And each time they compile, their feet are stabbed with the tiniest of needles.
 
@ThePhD well then GCC would be condemned to the same abyss for shipping every version of GCC prior to 4
almost all of which had non-deterministic behavior in various cases
 
@ThePhD Wait for their next survey and do a rant in one of the large textboxes.
I often do those, in anonymity.
 
@ThePhD did you see the beautiful link i posted for you? D:
 
1:36 AM
@MarkGarcia I do that every time... main target: WINSOCK
also lack of UTF-8 support in the CRT
 
@Mgetz You mispelled. s/O/U/
 
@MarkGarcia sigh
I really hope they add sockets to the standard library in some non-suck form
that way microsoft is forced to implement them in some non-suck form
 
reinterpret_cast<sockaddr*>(&sockaddr_in_var) FTW
 
user3010322
@Borgleader I'm blinded periodically by the vast incompetency of Microsoft's Visual C++ Compiler Team.
 
user3010322
So I probably missed it.
 
1:52 AM
using my amazing drunk logic engine, I deem the following the right thing to do...
 
wat
 
user3010322
wat
 
user3010322
Wasn't thecoshman voted on?
 
It's never been a voting system.
 
2:00 AM
yay nepotism!
 
My birthday, received quite a few greetings already :D
Don't ask me how old I am, it's between 21 & 49 (inclusive) ~_~
 
user3010322
@chmod711telkitty But you look 19!
 
:')
<3 even though you probably do not mean it :p
 
user3010322
Well I don't think I've even seen your face, so I probably can't mean it.
 
user3010322
But one can hope.
 
user3010322
2:13 AM
And pray.
 
user3010322
Zing.
 
the joy of the internets is that you can be what you want to be for the most part
 
lol doh I am not 49, not even close ... :p
 
user457812
Man, ducky keyboards are ugly and weird
 
@chmod711telkitty if you want to freak people out just say you're 10 years old... and never bother to mention that the base of that number changes yearly
 
user3010322
2:20 AM
10, base 2, is a rather scary proposition.
 
user3010322
So, the code finally works
 
user457812
The question is more which base you started in
 
user3010322
But only because I stripped EVERY SINGLE POSSIBLE using alias from it.
 
user3010322
At least, those inside the std::enable_if
 
base 64 ... I am not yet 10 in that case :x
 
user3010322
2:28 AM
COMPILER LIMIT
 
user3010322
LINKAGE SPECIFICATION NESTED TOO DEPLY
 
user3010322
fucking
 
user3010322
adhawjdhadkhwdhwdkhawjkdhwdkhwkdhawd
 
user3010322
There's a SPECIAL hell reserved for the individuals responsible for this.
 
user3010322
LINKAGE SPECIFICATION NESTED TOO DEEPLY
 
user3010322
2:38 AM
You know what's fucking stupid about this?
 
user3010322
I found this bug with STL over a year ago. Last summer.
 
user3010322
The bug was filed then.
 
user3010322
But then ti was filed as "Low Priority for Dev 14"
 
user3010322
Fucking hell.
 
user3010322
2:52 AM
@Rapptz Do you thinkit would be possible to use named parameters and stuff to make symbolic expressions evaluate multiple variables you could set?
 
user3010322
Like g( x = 5.2, y = 100.1 )
 
user1646075
3:09 AM
@chmod711telkitty base 32?
 
stack buffer overflow? ... wait that's only if the age is calculated on nano second bases ...
 
user1646075
hairy birdcage btw
 
user1646075
that's a two-bit buffer?
 
user1646075
hmmmmmm
 
user1646075
let's guess your age from your behaviour....
 
3:11 AM
said not telling
 
but it's between robor & sehe ... & more sehe than robor
 
user1646075
is potato an age?
 
user1646075
ohhhhhhhhh - ok
 
user3010322
What I need now is a way of naming variables.
 
user1646075
3:12 AM
start with i and work forward
 
user1646075
lunchtime. I'll have a cup cake in your honour
 
@ThePhD lol
@ThePhD probably
 
user3010322
@Rapptz I totally wanna do it. :D
 
user3010322
But named parameters would be hard.
 
user3010322
At least, to make it work compile-time style.
 
3:22 AM
been there done that
 
user3010322
Well, not the actualy named parameter bit.
 
been there, done that
 
user3010322
You'd have to count the number of variable types passed into the expression and add extra parameters for each variable type.
 
user3010322
Then you'd have to figure out how, if at all, you'd do the naming bit.
 
user3010322
I guess I'd keep a types<Tn...> list, and append as the expression grew larger.
 
user3010322
3:25 AM
And at the end, do a operator() ( Tn... ) variadic based on the types<Tn...> variadic pack built-up at compile time.
 
user3010322
Buahaha, I'm discussing this like VC++ can handle it.
 
user3010322
Hnnngh.
 
user3010322
Now I want to implement it. :c
 
user3010322
@Rapptz y u do dis 2 me q_q
 
user3010322
@Rapptz How come, though, you nest a symbol<R> when you know the return is an expression_t ?
 
user3010322
3:30 AM
If R is an expression_t, can't you just return R directly and use that? Why does it have to be a symbol ?
 
arbitrary nesting
also allows for things like
f * 10
 
user3010322
But if you do f * 10, and it's an expression_t,
 
user3010322
expresstion_t is considered a symbol, which will still get caught with other symbols, no?
 
I have to go.
It's time to finally get Smash 4 3DS
 
user3010322
Aww. :c
 
3:32 AM
I've been waiting for this day for like 17 months.
 
user3010322
inb4 sold out
 
user3010322
@Rapptz If you consider expression_t to be a symbol by itself,
 
user3010322
then you can reduce the nesting level of the templates by 1 for each expression,
 
user3010322
since each expression can be used directly as it is also considered a symbol by itself.
 
@R.MartinhoFernandes lol you pinged me
 
3:41 AM
what to watch on netflix?
 
user3010322
3:58 AM
@Rapptz Since we're already using SFINAE to determine if something is a symbol or not, we could reduce nesting by 2 by (A): getting rid of the symbol wrapper in the operators around something that was already a symbol, and (B): making constant, symbol, and expression all count as symbols using the symbol_tag: gist.github.com/ThePhD/f396fa545fc50097a9f0
 
user3010322
The better version of this would simply ask if the desired symbol being passed in had a function that took 1 parameter.
 
user3010322
And return something, anything.
 
user3010322
That way, you could chain variables with function pointers as well.
 
user3010322
Or other made-up unary functors.
 
user3010322
But reducing the nesting level by 2 was actually a huge gain.
 
user3010322
4:00 AM
I can actually see some of the constants in the expression in the debug window now. :3c
 
If you want to have more fun at the expense of language pedants, try developing an hypercorrection habit.
5
 
 
2 hours later…
5:48 AM
Morning.
 
user1646075
morning squire
 

« first day (1448 days earlier)      last day (3483 days later) »