« first day (1464 days earlier)      last day (3478 days later) » 

10:02 AM
Some people were asking if this is any slower and Chandler (a clang dev) said that it's not.
 
lol
that’s a C++98-level question
 
Oh yeah.
He makes a nod to Xeo's proposal.
 
user1804599
> I'm surffing throw internet for this answer but i cann't found it yet. — lol
 
There is no functor object at -Og or better, i.e. just at -O0.
 
Other questions: Does this make compilation or linking any slower? So he forwards this to Chandler and that's when the ODR/static/different copy per TU discussion happened.
but he mentions that this would only affect you if you take the address of it
 
10:06 AM
^answer not good enough
 
this is the entire answer
if you're curious
I know you hate videos, but well :v
I linked it to the exact time for you
1:25:30 is when the ODR talks start
 
@Rapptz No functor object either when ‘taking the address’, whatever that means.
(If it meant just using operator& then we’d be in trouble when pass-by-ref would be used, too.)
 
Hmm
@LucDanton but that's not a different TU!
 
Is that relevant?
 
@LucDanton algorithm.hpp
 
10:17 AM
Yes, that’s one of the super vanilla ones.
 
Ell
@FilipRoséen-refp sorry! I just missed that. I'm not, I'm on a OnePlus One
and sometimes I accidentally undo auto correct by going to correct it myself instinctively
 
@LucDanton By 'considering design' I meant my use of function templates vs functors.
 
The operators stuff?
 
yeah
 
@FredOverflow I think they are pretty >_<
The cassowaries (IPA: /,kæsɵwæri/) are ratites (flightless birds without a keel on their sternum bone) in the genus Casuarius and are native to the tropical forests of New Guinea, nearby islands, and northeastern Australia. There are three extant species. The most common of these, the southern cassowary, is the third tallest and second heaviest living bird, smaller only than the ostrich and emu. Cassowaries feed mainly on fruit, although all species are truly omnivorous and will take a range of other plant food including shoots, grass seeds, and fungi in addition to invertebrates and small ...
 
10:18 AM
Well, I have the types but no canonical objects.
 
yeah but still
Considering I have some higher ordered stuff and most of the stuff in my library are free-form template functions it makes it a pain to pass those around.
 
@Rapptz E.g. for range stuff there are times where I select whether I should call peek_front or front via using op_type = conditional_t<Cond, operators::peek_front, operators::front>;.
Interestingly enough the functors I use probably most are operators::identity/operators::forward, because they are defaults for things like range::sort etc.
 
So I kept watching the video.
Chandler said that this makes the .o file bigger and increases link times a ton if used in multiple TUs.
Maybe -flto would help there? I don't know. They just keep going. I think Niebler might be sick of the whole conversation lol
 
Obviously we need to take one step further with struct plus_name { constexpr operator plus_type() const { return {}; } } constexpr plus {};!
 
@Rapptz I remember the "can't we just use functions?" comment had a big success :P
 
10:24 AM
So yeah. I think that's a pretty big con.
But not one I'd lose sleep over at the end of the day I guess.
@AndyProwl Lol yeah. Just got there.
 
@Rapptz It can’t just be ‘used in multiple TUs’ though. It has to be more to the tune of ‘used across multiple TUs’ or something.
 
'included' I suppose is a better word?
 
What? Probably not.
 
Well I'm just reiterating what the clang/gcc devs and Niebler are saying.
 
Take a peek. There is no plus_object symbol in the object file. How can it take longer to link?
And I am ‘taking a pointer’.
 
10:28 AM
Not sure.
 
@Rapptz It can’t. It was rhetorical.
 
They're not my statements. Just other people's who are more knowledgeable than me at compiler/linker development :v
 
Sure. But aren’t my demonstrations compelling? :( I don’t require faith.
 
the compiler optimised this hardcore man :s
 
wut lol
 
10:31 AM
paste it here: gcc.godbolt.org
 
Why?
 
wait, what was 'wut' about?
 
Were you serious about how ‘hardcore’ the optimization was?
 
It was a hyperbole (?)
 
The item of interest was symbols though, not the quality of code generation.
 
10:35 AM
o.o
 
Doesn’t that make sense?
 
But wouldn't the quality of code generation affect the symbols in the object file?
 
They’re not independent of each other, yes. But what does looking at the generated code tells you that the symbol table doesn’t already for the purpose of ‘how does this affect linking?’?
If there is no symbol, there’s nothing to link.
 
I don't think either of you are wrong.
Like I said earlier, maybe if there would end up being symbols then maybe -flto would have helped there.
No?
 
hey, @R.MartinhoFernandes why did't you say you uploaded a gif of you soldering?
 
10:39 AM
@Rapptz Adding too many variables here.
 
Isn't it inherently complicated?
 
What does the discussion become? ‘Function templates’ vs ‘Function objects without -flto’ vs ‘Function objects with -flto’?
 
Ell
@thecoshman why does he put it up to his mouth? :P
 
@Rapptz What is?
 
@Ell ak him your self
 
10:41 AM
I haven't experienced code bloat that Chandler speaks of.
I just consider it something to keep in mind.
 
To clarify, I don’t think that using canonical functor objects is a panacea (hey, I’m not using them in fact). But a lot of the arguments you mentioned is vague FUD on the style of ‘but who will think of the bloat???’ that can be applied to regular constants, which is where I find this grating.
 
Well I don't find using constexpr function objects as a bad thing in general.
But it still sticks out in my mind.
If it doesn't cause 'code bloat' then there are no cons to it in my mind that stick out :s
 
See, looking at the video the first comment on ODR mentions a scenario where another TU is involved.
I told you :<
 
Is.. is that not what I said :(
 
Should boost serialization conflict with my operator<< ?
 
10:48 AM
@Rapptz You just said ‘ODR’ and left it at that.
 
32 mins ago, by Luc Danton
Is that relevant?
 
Two separate questions/comments:
a) does that affect linktime
b) what about ODR?
 
Sorry for sucking at communicating this
 
It was not relevant to consider other TUs for the example of mine you linked to.
To cut a story short there is no issue regarding ODR (otherwise we would be fucked already with regards all our constants).
 
Swift topic change: It took me 4 minutes to think of 'OpenCV' because there are so many 'OpenXX' libraries.
Horrible uncreative names can die.
That is all
 
user1804599
 
If I want a vector<int> to be a default parameter is it okay to write, ...(..., vector<int>& foo = vector<int>()){} ?
 
No. For the same reason you can’t define a variable std::vector<int>& ref = std::vector<int>();.
 
Hm but it does compile, why is that then?
 
fucky compiler
 
user1804599
Are you sure your parameter is not const&?
 
10:56 AM
haha
 
I think MSVC is the only compiler that allows you to bind temporaries to T&
 
Why is that a bad thing?
I guess I could make it const&...
But if I need my vector parameter to be a default parameter what is the best way to do it then?
Or should I just overload the function
 
You could have another overload, yes.
 
So there is no "good way" to have a vector as a default parameter?
 
‘Good’ meaning what? E.g. you mentioned const&, what’s bad about that?
Alternatively it is a bit unusual to accept a vector by non-const ref and have a default value for such a parameter (that’s not a global or similar).
 
11:05 AM
I guess I have some bad programming practice when it comes to using const-refs. What are some thumb rules on when to have const-refs and when to not?
 
There are some resources on the matter on SO, but I can’t say I can find any one that stands out.
 
But I should "always" make it a const& if I do not intend to change the value?
 
Absolutely.
 
Oh
That is a lot of coding gone wrong :|
 
@R.MartinhoFernandes so did you get to play XCOM yet?
 
user1804599
11:21 AM
No reason to make things mutable when you're not gonna mutate them.
 
user1804599
Only wreaks confusion.
 
user1804599
If a function takes T& where T is non-const, I assume the function will mutate it.
 
Hm which way to write is prefered, const type& or type const& ?
From what I understand they mean the same thing
 
user1804599
Just be consistent.
 
user1804599
Both are preferred by different people.
 
11:30 AM
It's the same, but I prefer const-after because of (1) consistency (you can't always put const before) and (2) it makes it simpler to reason about type deduction when using templates
 
Ell
@halfevil why are you taking a vector anyhow?
Are you sure you don't want a pair of iterators?
 
@Ell the function needs some strings and I figured a vector was a good way to go. Does it make any difference if I take iterators as I pass the vector by reference anyway?
 
@jalf no. They only have one fucking table, and it's always crowded. :( so, no.
 
ah, lame
Meanwhile, I spent all day yesterday playing Tash-Kalar
 
@Rapptz You know, I think that all told @R.MartinhoFernandes, @Xeo and I have, or have had, somewhat similar styles when it comes to writing C++. In fact, as I recall, Xeo has always found it silly that I use namespace operators. Instead it should be namespace functors (which I think he has used), and functors/operators.hpp could contain functors::plus, since it’s a functor version of the plus operator.
 
11:51 AM
@Puppy you realise it's your turn again right?
 
user1804599
Why do Haskell and Scalaz have Semigroup but not Group?
 
user1804599
Is it impossible or not interesting?
 
12:06 PM
Jesus christ
They were able to fit more special rules even in concepts
What would you guys honestly expect from the notation void func(SomeConcept a, SomeConcept b)?
What would be the translation into a less terse notation?
 
@Sofffia I'd expect that to create a single function that uses SomeConcept for runtime type erasure ;d
 
@rightføld because a semigroup is a group
 
@Griwes wat
 
user1804599
@thecoshman wat
 
user1804599
Semigroups are not necessarily groups.
 
12:14 PM
Well, I would expect func(someint, somedouble) to compile as long as int and double satisfy SomeConcept.
Well, WRONG
 
It creates a template that takes two arguments of the same type satisfying SomeConcept or what?
 
Because it actually translates to template<SomeConcept Type> void func(Type a, Type b)
 
That's why it should create a single function accepting a type erased something based on SomeConcept.
Except for lambdas, we shouldn't have a syntax to create a template without saying template.
Otherwise it's confusion all the way down.
 
We should have always had a syntax to create templates without using template
 
Nope.
 
12:19 PM
Something like void func(auto:T a, auto:V b)
 
Ugly.
 
or simply void func(auto a, auto b) if you don't care about the types
which... would be consistent with lambdas
 
Lambdas are special goddammit. :P
 
you are special :P
 
You can always do auto func = [](auto a, auto b) {}; if you so wish.
Yes, I am indeed special. I can see that f(Concept, Concept) should be type erasure, not a template :P
 
12:22 PM
@Sofffia Er.. Right.
@Sofffia Yes.
 
I meant someMyTypeNotConvertibleToOtherMyType and someOtherMyType
Seriously, what's wrong with something as simple as auto:Type argument for templates?
 
It's disgusting.
 
It's ugly as hell.
 
More disgusting than template<class Type> void func(Type argument)?
 
Yes.
 
12:27 PM
You guys have issues
 
You do.
 
Seriously, go to some oculist
Ask for TheWayJefffreySeesIt glasses
 
I don't want horrible taste.
 
@Rapptz Ok, so propose something better than template<...> ...
That could be used for lambdas too
 
Why?
 
12:29 PM
iunno, some unified syntax
 
It's already a solved problem.
 
Just to see what are you fantastic tastes
 
Unlike you I'm not allergic to seeing template<typename C>
 
I'm not either
I can see there could be some better syntax
 
Between that and ConceptsLite there is no better syntax I can think of.
See this paper open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3878.pdf for actual proposed syntaxes.
@Sofffia Good!
@Sofffia Concepts Lite terse syntax could also be used for lambdas but I agree that the fact they're the same type could be a con.
I'm actually not even sure why it is the same type.
It sort of makes sense. When you see void f(T a, T b); you expect them to be the same type.
 
12:37 PM
meh
@Rapptz Except for auto I guess
 
lambdas are a special syntax IMO
 
I'm not talking about lambdas
 
I'm still against void f(auto a, auto b);
 
void f(auto a, auto b) is the proposed syntax for normal functions within concept lite IIRC
 
don't think so
 
12:40 PM
yesterday, by Sofffia
We get: auto func(const auto&) function declarations?
Andy says so
And I was watching the CppCon concepts video at the moment
Oh wait
You know that. You engaged a long conversation on the fact that it has no use vs concepts.
 
@Sofffia is that one of the 2014 videos?
 
CppCon 2014
 
danke
 
^ this is part 2
 
Concepts Lite doesn't specify the behaviour with variadics.
I did a quick ctrl + f and it just glances over it
 
12:45 PM
Nobody was talking about variadics v0v
 
template<MyConcept... Args> void f(Args... args);
I know.
It's a topic change.
Would f('a', 10, 1.f) work?
Paper doesn't talk about this at all lol
 
So you are convinced that void f(auto a, auto b) is proposed in Concepts lite?
 
Yes.
 
@Rapptz hmm that would be interesting, you really could do a fully typechecked printf then but you'd need an outputable concept
 
Good!
 
12:47 PM
I don't get people's obsession with type-checked printf
and I implemented my own printf a few days ago
 
user1804599
Any sane compiler type-checks printf.
 
You can already do a type checked printf in C++11.
 
user1804599
Yes, it's called -Werror.
 
-Wformat only works on static strings
 
user1804599
I have yet to find the need for non-literal format string passed directly.
 
12:48 PM
Me too.
But it's possible so it shouldn't be dismissed.
 
It's a shame that C++ committee guys don't care about haskell typeclasses.
 
@Rapptz it's not typechecked printf that matters, it's generic access to types in a variadic function
 
They could have learned something along the way.
 
@Mgetz What?
 
Bjarne says he is not interested in functional programming, this concepts guy explicitly says he is not interested in typeclasses in haskell.
Being blind to what other languages did right is truly shameful.
 
12:53 PM
@Sofffia Not even remotely true.
> Bjarne: I do agree. The inspiration for a lot of the STL is functional programming, and if you look about—sort of, you go through data structures, you apply operations to it, you combine algorithms, you work generically or different data types. All of that is functional in inspiration.
> We’re not trying to turn C++ into a functional language; we’re trying to see what parts of functional programming techniques can fit in with object-oriented programming, and things like that.
 
~59:00 of the video I linked above, the guy says what I said he said above
About Bjarne, I remember him saying that in some video, but I might be mistaken
So at least for 50% of what I said, it is remotely true.
 
Also
'not interested' != 'being blind'.
@Sofffia Is EqualityComparable not the same as Eq?
 
@Ell except as it is there is no need to do any of that. The current logic could be expressed as coliru.stacked-crooked.com/a/b9c1e67728d03dbf /cc @FilipRoséen-refp
I just helped @ell past the compilation troubles he had. I'm not saying it's a sane path to "overload resolution" (whatever that is). I can only assume such things working with proper variant visitation and compile time deducted tables of (implicit) convertibility between types. It's really quite a task. I'd say perhaps libclang would be useful (or: a welldescribed much reduced set of features)
 
@Rapptz Yes
Kinda
 
'kinda'?
What's different.
 
1:05 PM
EqualityComparable doesn't seem to define how != would work
Eq does
 
It does.
What definition are you looking at?
 
is the one I was talking about
 
then yes
 
1:07 PM
@nil You can become the TTS narrator voice
 
@Sofffia Kinda weird tbh.
All definitions I've seen of EqualityComparable require both.
 
They might have forgot it
 
It seems the standard doesn't require it.
Interesting.
Might just be to simplify requirements for the end user.
 
Unless != is explicitly defined as !(a == b).
In that case it's implicitly defined != too
Being that ! on bool is valid
and a == b is implicitly convertible to bool
or something
 
hmm
 
1:13 PM
such a kitty I am
 
You are a crow, remember?
 
@sehe if he doesn't need the ability to change the overload resolution "set" during runtime, he should use some TMP to make most of the decisions happen during compile-time (together with std::is_polymorphic, some SFINAE to see if T is convertable to U, and then dynamic_cast (runtime check)) /cc @Ell
the above would actually turn out quite neat in code, as well as being able to closely mimic the behavior of the "real" overload resolution (in terms of conversions) using simple scoring based on the number of conversions
this require certain properties to be known during translation, such as the static type of the arguments that are to be used when invoking function x, but it also means that he could correctly handle x(123) having void x (float) (using just typeid will make that very cumbersome)
 
I feel the disgusting need to use nullptr_t as a unit type in C++.
 
Unit type?
 
It can’t work because it’s not a type, so you should be good to go!
 
1:26 PM
Like () in Haskell?
 
fuck that doesn't work
 
Why would you need a unit type in C++?
 
is nullptr_t not allowed in constexpr? :(
 
looking it up
 
1:28 PM
IO nullptr_t
 
void isn't allowed in constexpr until C++14.
So I was looking for a type to replace that for my nub C++11 constexpr.
 
@Rapptz in what context?
 
?
What other context?
 
Why do you need a dummy constexpr value again?
 
I'm just asking about where such type would be required, kinda what @Sofffia is asking above.
@Rapptz why not use some dummy-type from <type_traits>? like std::rank<void> or something
 
1:32 PM
most are undefined
 
@Rapptz Should be fine.
 
@FilipRoséen-refp It happens.
I'm writing a for_each thing atm that would go nicely with constexpr
 
there are plenty of types in the standard library one can use as a "dummy type", still not sure why you'd require such type though
decltype(std::ignore) might be suitable, not sure what the standard mandates of that type (besides being a NOP on std::ignore = expr;
 
You’re the dummy!
@Rapptz Heh, I didn’t bother with. You want it if you have relaxed constexpr, but if you have constexpr you can have it.
 
lol it might not even work
but at least I tried
 
1:39 PM
Eh with a conforming compiler you can use the magic {}.
 
return GEARS_EXPAND(f(adl::get<Indices>(tuple))), nullptr;
it's beautiful eh?
 
Are you using braces? If so, which kind?
 
the macro expands do void(some_array_type{(0, expr, 0)...})
 
@Rapptz I’m not sure if it helps with the disgust, but it can perhaps justify your need: std::nullptr_t is of course isomorphic to unit.
err
hang on
I need a drink
 
@LucDanton Yeah I know.
 
1:45 PM
@Rapptz That’s the GCC-friendly expand isn’t it?
 
I believe so
I think I should add a void() there to guard against operator, overloads
 
I’m fairly sure it’s the one I use, I have doubts because, well, this is about compiler betrayal :(
 
I learned it from Xeo eons ago.
 
@Rapptz Ye, I don’t have the initial zero either. I go expr, void(), '\0'.
 
the initial zero is because I remember MSVC complained about it even though I don't care about MSVC
 
1:48 PM
I think I use '\0' partly because of preferences, partly because with some flags there’s a compiler that warns?
Mmh I could set up a test that checks e.g. EXPAND(canary = i++) to catch when GCC fixes that.
Or *p++ = *q++? I’ll figure out something.
 
Some how this makes me think of MERCA!
 
2:04 PM
@thecoshman Funny ending.
 
thinking of calling tuple::apply -> tuple::expand
 
@LucDanton lol
 
I have tuples::invoke but that actually calls element 0 with the rest. It’s fairly useless.
 
user1804599
Hmm.
 
user1804599
I can make repositories in DAL subtypes of mutable.Map[ID, T].
 
user1804599
2:12 PM
Perhaps.
 
user1804599
> Add a key/value pair to this map, returning a new map.
 
user1804599
well fuck
 
user1804599
Mutable databases are terrible.
 
@LucDanton tuple::invoke is good.
 
ikr, and I’ve used it for something dubious
 
2:14 PM
looking through my I code I do have a tuple_invoke that does tuple::apply essentially
heh
I find it a bit odd that I have for_each(Tuple, F); but invoke(F, Tuple);
 
user1804599
2:35 PM
@Creris If the OP doesn't bother to follow the link when it's put in an answer, what makes you think the OP will treat it any differently in your comment? — hvd 3 mins ago
 
user1804599
:D
 
2:56 PM
<strike>I don't think Asio is your library then<strike/> Aw blimey! A 5 second google later: github.com/kevincon/asio-rawsockets-examplesehe 1 min ago
 
so it's only taken me like 6 months to realise my speakers were backwards :(
 
user1804599
> A comathematician is a device for turning cotheorems into ffee.
 

« first day (1464 days earlier)      last day (3478 days later) »