« first day (1597 days earlier)      last day (3577 days later) » 

15:00
for no reason whatsoever except "omg i'll get arthritis if i type dem extra 6 characters"
@AlexM. it's not about doing something different, it's about consistency
and having less special cases
@Jefffrey It's also the primary place where auto nearly always does the wrong thing.
user784668
@Jefffrey Seven. auto&&e is legal, but ugly, so add the fucking space.
@Jefffrey I thought it got dropped.
@Jefffrey what will the type of e be? Const ref I assume?
ooh Unity is clever enough to keep the old references when changing a field from T[] to List<T>
in the editor, that is
15:01
@Fanael I'm watching herb's talk, and he says at beginning it's better to use auto& and he will explain later
Puppy's right, the proposal got dropped
so for now I'm sticking with 6 characters
I heard they wanted to make a new proposal though
Also I don't understand why auto&& should be the default
next up: a is a reserved identifier for auto
because, why type auto when you can type a
I actually like for (e : sth) lol
why not
15:04
well, what type would you want e to have?
auto&&.
it's inconsistent in the only place C++ has actually been consistent until now
why not auto without &&?
they always say value semantics is the default in C++
Who wants to iterate over copies?
so why would for have reference semantics by default
15:05
Because it helps beginners, and it's what you want in 99% of the cases, anyway.
@AndyProwl something& I think
@Jefffrey What, inside the unique syntactic construct where the : has a meaning that is totally inconsistent with the rest of the language? Yeah, we certainly can't have any inconsistence there
@AlexM. auto&& will be something& in most cases.
I can't remember ever wanting to iterate through copies
@AndyProwl Because referring is strictly more useful than value here.
15:06
@jalf Good job trying to justify inconsistency with other inconsistency
@Jefffrey no, it is justified by being convenient
user784668
@Jefffrey I propose the keywords should be: aligna aligno as au bo br cas cat char char1 char3 cl const conste const_ cont dec def del do dou dy el en expl expo ext fa fl fo fr g if inl int l m na ne noe nu o pri pro pu reg rei ret sh sig siz static static_a static_c str sw te thi thre thro tru try typed typei typen uni uns us vi voi vol wc wh
@Jefffrey You're the one who seems to argue that "despite C++ being inconsistent as fuck all over, consistency is IMPORTANT" :)
@Puppy I'd stick with value semantics by default. If references are needed, they can be reached for by typing && or & or const&.
15:07
you'd stick with value semantics by default despite the fact that references are strictly more useful?
interesting choice.
@jalf Yes, keeping that little consistency you have and not fuck that up is a good thing.
@AndyProwl the problem is that writing const auto& every time you want to iterate over something kind of takes the convenience out of the construct that was specifically created for convenience
I'd stick with value semantics by default for consistency
consistency with being useless is useless.
@jalf Why should I write const& every time I want to iterate over something?
15:08
@Jefffrey You haven't established why that would be the case
user784668
au x = l{5};
user784668
I like it.
most of the time when I need to iterate over stuff, I don't need reference semantics
@AndyProwl because except in fairly specialized cases, you don't want to iterate over copies?
@jalf Regarding what specifically
15:09
@jalf Why not?
@Fanael there was a language in which you were able to type the first letter of the instruction only
and still have it compile
I don't think they're fairly specialized cases
I have no idea what it was, probably some ancient fortran-like language
@AndyProwl I often iterate over, say, containers of unique_ptr.
@Jefffrey Why is it important to be consistent about variable declaration in these loops?
15:10
Because if you are not consistent you are increasing complexity in a language that definitely doesn't need extra complexity
@Puppy I sometimes need that, but 1) it's not the majority of the time, and 2) very often I don't need to write those loops manually (I end up using named algorithms instead).
Also, in lambda captures, where the type specifier is not present, auto is implied. For consistency I'd like to see the same in other situations.
@Puppy Wait, why would you store unique_ptr in a container?
er, to contain them?
why wouldn't I store unique_ptr in a container?
why not just the values?
why unique_ptr?
@Jefffrey Every addition to the language increases complexity, whether it is consistent or not. Either we accept some complexity in return for a certain amount of convenience, or we never ever make another change to the language
15:13
er
inheritance?
@Jefffrey You may need to treat those objects polymorphically
just for one obvious reason.
std::reference_wrapper :P
here's another obvious reason
because other people are going to be referring to them by pointer and I don't want to invalidate those pointers?
@jalf Absolutely disagree.
15:14
every addition to the language does definitively add complexity.
@Jefffrey Good for you. So you feel that some complexity is sacrosanct and must never be increased, but other kinds of complexity is ok?
range based for loops were an addition to the language that did not increase complexity of one bit
@Jefffrey That means clients need to take care about lifetime. Also, reference/iterator invalidation, as Puppy wrote
And you are arguing against inconsistency? :D
@Jefffrey Uh,yes they did
new unique syntax, new unique meaning for the : token, and new text added to the standard
@AndyProwl hence the ":P"
user784668
Next in C++20: foo(x, y, z) { … } will be legal.
@Jefffrey Ah, all right
who needs inheritance anyway
@jalf new syntax that you can or cannot use, and yes unique syntax is good
for lambdas too
user784668
With the meaning template <typename T, typename U, typename V> auto foo(T&& x, U&& y, V&& z) { … }.
15:17
you are simplifying things that were very hard to write before
@LightnessRacesinOrbit wait, alf listened to reason? Hell (the US) really has frozen over
with for (e : c) you are saving 6 characters
that's being sloppy
@Jefffrey Oh, you mean like when allowing the programmer to omit auto?
Sorry, but if you want to argue for consistency, try to at least come up with consistent arguments?
@jalf that's not simplifying, that's confusing
I can foresee the sea of "why does this code compile, where is e declared?" questions coming to SO
by C++30, C++ will basically be a far uglier version of JavaScript
15:18
"Inconsistent : is to totally cool and simplifies the language. Inconsistent auto is pure evil and only makes teh language more complex"
user784668
Honestly, I probably wouldn't be even mad.
"is it using e declared above?"
@jalf new unique syntax is not being inconsistent
@Jefffrey : is not unique. It already had meanings in C++
adding a new syntax that introduces inconsistency in something that was preexisting, is consistent
It was given one new additional meaning
It is not a new syntactic token
15:19
lol
I forgot you are jalf.
6
The discussion ends here.
Xeo
Xeo
wtf kind of argument is that
@Jefffrey Ah yeah, good argument. Nothing says "I'm right" like ad hominems
@Xeo I'm pussying away
for the sake of my body health
"My arguments against inconsistency are so consistent that I have to resort to name-calling"
yup, I'm dumb
you win
15:20
I'll give you this much. It is entirely consistent with everything else I know about you
IMO they should just abandon the for (e : c) thing. There is no "most reasonable" default and it does not change much in terms of readability.
As for saving keystrokes, that should not be a rationale.
Xeo
Xeo
@AndyProwl They dropped it for C++17, no?
@Rapptz Except in any sane system NULL != NULL!
then you're fucked
@Xeo They did yes, but I've read somewhere that they were considering writing a new proposal.
@jalf : is by no means as important as variable declarations
Xeo
Xeo
15:22
C++ makes the whole implicit thing complicated thanks to lifetime issues.
I think I'd like to see op< for std::optional sort by is-set-ness in the first instance, then object address for nullopt_t and op< for the value type otherwise
Xeo
Xeo
The only reasonable default is by-value.
also where else do we see : alone again?
Good luck finding shit though
Xeo
Xeo
Since you can then apply wrappers to make it by-ref.
15:22
I hope you are not referring to ?:
user784668
@Jefffrey label: ;
@Xeo I agree
yeah, if you kill gotos your consistency is back
user784668
ctor init list
15:23
@AndyProwl agreed
I forgot they even existed
@AndyProwl agreed
for (e : c) is completely retarded
Xeo
Xeo
That's also the default std::bind (and by proxy std::thread etc.) have adopted.
@Fanael hah, oh yeah ...
And generalized lambda captures
Xeo
Xeo
15:23
ye
@AndyProwl I have mixed feelings on that. Keystrokes rarely matter (although auto replacing long overly verbose type names probably shows that in extreme cases, keystrokes do matter). But simpler structure, or requiring you to type fewer tokens, does have some value. Makes it easier to get the code right if I don't have to remember complicated syntax, and it's less clutter and visual noise too
Xeo
Xeo
Any other generic default is just too dangerous.
huh... do I need to do anything special to use my own type as the value in a std::map?
Xeo
Xeo
I mean, std::bind is not directly by-value, but in effect it is (copying / moving internally)
the syntax is more complicated this way
user784668
15:24
@thecoshman As the value? No.
@thecoshman um... Define the type? :D
there are already far too many ways to declare objects. now name is one of them? and only in one construct? fuck no.
I think that's all
for (auto& e : c) is now "complicated syntax"
7
Xeo
Xeo
@jalf auto is also important in generic code
@jalf ¬_¬
for (e : c) is much less complicated
@thecoshman It needs to be copyable or at least moveable, I guess.
relax people
@Xeo Yeah, sure, but a big part of the reason why it's considered useful is just that it lets us save tedious error-prone typing
15:25
you'll all be done with C++ before your workplace switches to compilers supporting for (a : sth) anyway
/troll
@FredOverflow ah right... I think my type is...
Xeo
Xeo
@jalf ye
@jalf No, it's because I know you and you like to troll.
I think the committee knows advanced C++ too well. They're obsessed with "improving usability" but entirely forgetting that they're making it less consistent, less readable, less useful, harder to write, harder to comprehend...
I'm pretty sure you openly admitted that at least once.
15:25
Hi. Is there a paid or free service that will try to compile & unit test your codes on different platforms and report the status?
You can't "improve usability" by fucking up so bad
Xeo
Xeo
@Jefffrey Just drop it.
@jalf It's not much about the stuff you have to type, as about the stuff you have to read. Of course the less you type, the less you need to read, but it's the latter we should focus on, not the former. Less syntactic noise does help in terms of readability, yes, but in this case it does not seem to be a game changer
4auto e : c
3
Yeah so I gave up trying to explain that rationally halfway through
15:26
While in the case of auto and verbose type names, it is
So if I see you coming up with extremely stupid shit like above, I'm assuming you are trolling and just move on.
@Xeo How about you mind your own business?
user784668
@Xeo I'd drop @Jefffrey and @jalf from somewhere high tbf
It's the second time you tell me to drop a discussion with someone else.
foreach (var e in c) is what C# uses, right?
15:27
I find that quite nice.
user784668
@FredOverflow var?
you need var if you want deduction
@Jefffrey Well, he's a room owner. He's just doing his part.
@AndyProwl What part?
He should be saying that to jalf.
15:27
pretty sure D uses foreach (a : c)
But this room has a cabal
Xeo
Xeo
@Jefffrey Because at the end of them, they aren't discussions anymore. They're just noise.
@AlexM. What do I do if I want e to be immutable?
@AlexM. Doesn't it use a semicolon?
@Xeo A bit like what you and Jefffrey are currently engaged in?
@Jefffrey Telling you not to get heated
15:28
T(T&& other) is move constructor right?
@FredOverflow you do fancy things with interfaces
@thecoshman yes
@Xeo As I told you already, if you really can't stand that 5% of "noise", then just plonk me.
@AndyProwl I'm always "heated" baby ;)
C# const doesn't work like C++'s const
15:28
@LightnessRacesinOrbit TIL this room is Haskell
@LightnessRacesinOrbit lol I'm out
@AlexM. No I mean can I do final var?
@ParkYoung-Bae where have u been m8
@FredOverflow no
@LightnessRacesinOrbit Outside
15:29
@AndyProwl Now people can't get heated?
o_0 why the star?
const var?
you cannot do anything like foreach (immutable a in something)
That's retarded.
The worst that can happen is that we plonk each other and goodbye.
15:29
@thecoshman because it's hilarious that you had to ask whether T(T&& other) was a move constructor
user784668
@FredOverflow No. In C#, local variables are always mutable.
@Jefffrey IMO it's best for everyone if they don't
@AndyProwl you're so .... cold ...
user784668
Except when they're compile time constants.
I love angry discussions, they bring the best out of people.
2
15:29
@LightnessRacesinOrbit vOv I am stuck in Java all my days, and I just wanted to make sure
@FredOverflow right, with ;
@Fanael oh god really
@LightnessRacesinOrbit If the line above that say template<typename T> void, then it's not a move constructor.
@LightnessRacesinOrbit :( (lol)
@FredOverflow never missed that feature in C# tbh
15:30
They also cost in terms of health, but hey, it can be a decent tradeoff.
if I don't want to change something in my for loop I just don't change it
@FredOverflow or /*
likewise, a type is automatically moveable if it only uses a moveable types, right? You only need to do it explicitly if you need to do something 'special'
user784668
@LightnessRacesinOrbit or #if 0
@Fanael or #!/usr/bin/perl
15:30
I could have used const for method parameters a bunch of times
@thecoshman According to the standard, yes. According to VS 2013, no.
Xeo
Xeo
@thecoshman That's the base of the Rule of Zero, ye
@thecoshman just like copyability
user784668
@LightnessRacesinOrbit Probably a legal Perl, though.
@FredOverflow yeah, but GCC
15:31
@Fanael maybe
then why is map complaining about my type :\
@thecoshman Show us teh codez
user784668
@LightnessRacesinOrbit Yes.
@AlexM. Way to miss the point of const
"If you don't want to change a variable then don't change it" as an argument again const is pretty dumb.
How many different line break conventions are there? Only 10 and 13, 10?
Xeo
Xeo
15:32
wtb default const
@LightnessRacesinOrbit I'm not arguing against const
I'm saying that I don't miss the feature in C#
user784668
@FredOverflow Only LF matters.
@AlexM. You're arguing against caring about not having it
hold your horses
By extension, you're arguing that it isn't needed
user784668
15:32
I never seen CR LF in the wild really.
By extension, you're arguing against it from a "if we were to start from scratch" perspective
a bit of a leap, I realise ;p
@Xeo inb4 Bartek
@AndyProwl ergh, I would have to properly put it into a SSCE
Short, Self-Contained Example
@Fanael Isn't that what Windows uses?
@Xeo Once I wanted to write a using const { ... } proposal for making const default in that section.
Plus I want to think about this a bvit first
shit
@AndyProwl OOOOOH
I wrote a foreach loop that isn't a foreach loop today
BanterPanels.ForEach(p => p.gameObject.SetActive(false));
yay
Xeo
Xeo
@AndyProwl yeah, can't have default const everywhere anymore, breaks all the things :/
user784668
15:33
@FredOverflow Is it? I use Windows and store everything as LF.
@Fanael I don't think Notepad can do that :)
@Xeo #pragma defaultconst
Xeo
Xeo
and also can't introduce var as the opposite of const really, since it's way too common a name
@Xeo compiler flag
#define auto const auto
user784668
15:34
@FredOverflow I never program in Notepad.
Xeo
Xeo
@LightnessRacesinOrbit Yeah, C++ would need a system to allow that standards-wise.
Xeo
Xeo
@LightnessRacesinOrbit So long! :P
@Xeo #define mut mutable
Xeo
Xeo
macros.
15:34
I'd be fine with mutable, or mut
user784668
@Xeo That's great! People will think twice before making stuff mutable!
fuck #define var mutable
there is evidently nothing wrong with this particular macro
user784668
#define mutable mutable
Actually, the fact that it is long should not be an issue, because it would be used sparingly
you can't just hate on it because it's a macro
that's macrist
user784668
15:35
@LightnessRacesinOrbit I can.
@Xeo well, you shouldn't be using it really :P
In Rust it's mut isn't it?
@AndyProwl yeah
15:35
After a restart, a clean and rebuild it compiled with no erros. Sorry for wasting your time with that nonsens -_- — Fabian 3 hours ago
I should get back to Rust
@Fanael notepad rocks :)
I've been studying it for one day, then dropped
¬_¬ std::map<std::string, myType> should be fine right... myType is moveable, but not copyable (by design)
15:36
Yes it should be fine
like, this isn't just a bad choice for key is it?
Wait what are you trying to do with the map?
seems it can't handle this 'pair' for some reason
Aaah
wait maybe I know what's going on
Xeo
Xeo
@thecoshman sscce
user784668
15:37
@YourFriend Yes, rocks are a better editor than Notepad.
are you using pair<string, myType> const& or something?
if so, you might be getting a copy
@Xeo wait... isn't a sscce impossible with for compile errors?
Xeo
Xeo
@thecoshman no?
It should be pair<string const, myType> const&
@AndyProwl I am not using a pair, it's the map that want's to through pair into this at some point
Xeo
Xeo
15:38
Short, Self-Contained, Complete Example - nothing about being able to compile successfully :P
oh, complete :P
oi, wankers
VTC please
@thecoshman ok so you're not typing pair<...> anywhere are you?
@LightnessRacesinOrbit what does that mean?
Xeo
Xeo
and even if it was "compilable" - doesn't mean compilation has to finish successfully :D
@thecoshman oh cosh
15:39
@Fanael I love it when there is not other framework installed on my computer :)
@AndyProwl no
Xeo
Xeo
@thecoshman sscce, get on it!
@Xeo ¬_¬ pedantic, but true
@thecoshman It shall result in only the compile error you're asking about. That's its purpose.
@Xeo grumble grumble, hang on
15:40
@thecoshman ok, then it must be something else
in Rust, Feb 17 at 8:43, by Luc Danton
Rust programmers confide that they don’t use mut all that much. Yay for immutability by default!
seems relephant
user784668
@YourFriend there's Internet Explorer though so you can download Emacs or Vim or whatever
Madonna (r) and her daughter Lourdes (l) in 2011
haha
@Xeo youngsters and their fancy unicodes
15:43
@Fanael sometimes even the net goes down. so notepad is really the best for worst case secnarios
back in my day we only had numbers and letters
and we were better for it
@Xeo ahahah dat flip
Xeo
Xeo
@LucDanton Guess I should check out Rust at some point
it’s working!
Xeo
Xeo
lol
15:49
hmm... I can use my type in other collections, like vector and set... but it seems the value can't be used in maps...
user784668
How much does Rust suck?
@Fanael so-so
@AndyProwl my compiler errors are complaining about pair stuff...
@Fanael it's awesome, just lacks libs
Xeo
Xeo
@thecoshman Do I need to repeat myself?
What is rust? I remember it was a Map in COD4MW2
15:50
@thecoshman It's likely that you're inadvertently causing a copy of a map's value or of the whole map
yay now when I encounter an enemy a nice music effect plays and one of the characters announces the encounter (text + voice)
@AndyProwl I was just trying to allocate one :P
@thecoshman The most frequent fuckup I've seen was with using pair<K, V> instead of pair<K const, V> but it seems that's not your case since you wrote you don't type pair<...>
@Xeo of course not, but prooning out the cruft is not trivial, and not doing so is nt helpfull
Where is this god fucking damn SSCCE?
And why didn't it exist two days before the conversation started?
Xeo
Xeo
15:52
lol
user784668
@LightnessRacesinOrbit Obama stole it
user784668
Thanks, Obama!
@Fanael To clarify, what sucks the most is what’s not present/doable in the language yet. What there is already, is mostly fine.
Classic Obongo
15:53
steady on now
inb4 flag
Obama is overrated
user784668
@LucDanton Does it have Turing-complete type system yet?
Some people have claimed so, although I haven’t checked myself.
I feel like writing C++. What is even going on.
15:54
The trait resolution system being a logical programming system like Haskell type classe instance resolution sytem is. I don’t know much beyond that.
@Jefffrey have you used Qt?
Yeah, for a uni project 2 years ago.
I just did a terrible thing by answering that, didn't I?
How is it? great for creating c++ desktop applicatioons?
yeah you did but forget it xD
user784668
@YourFriend Yes, if you don't forget that C++ is terrible for creating anything.
Is it nice? Probably not. Does it get the job done? Yes.
15:57
Would just the type I am trying to use as value suffice for y'all. My error is triggered simply by trying to make declare a map (error can be provided too ofc)
@Jefffrey so which framework is great for creating desktop applications in c++?
Dunno, never tried anything else.
user784668
@YourFriend Not C++.
@Fanael your input?
@YourFriend how to make a great desktop application in C++
1) Make one in C#.
2) Make your C++ program start it.
15:57
lol
2nd point ?
user784668
@YourFriend I agree with @AlexM.
Either way, here is my problematic class. I don't see why I can't use that as a value in a map.
You mean run it by creating c++ .exe file? @AlexM.

« first day (1597 days earlier)      last day (3577 days later) »