« first day (279 days earlier)      last day (4660 days later) » 

sbi
8:00 PM
The only thing I can think of is that someone undeleted an answer which I had downvoted earlier.
 
@CatPlusPlus Sorry to hear that, though I guess being fair, I should add that I've never been to Poland either. I got semi-close a few times (Hungary, Russia, Romania), but not Poland (so far, anyway).
 
I'm not too sad about it. :P
I don't like travelling too much.
 
@JerryCoffin Closest I've gotten is polish sausage, which happens to be delicious and goes well with sauerkraut :)
 
@Josh Hm...Polish sausage is all right, but at least to me sauerkraut is almost as bad as lutefisk...
 
Whoa nelly
You just compared sauerkraut to lutefisk?
To each their own, for sure!
Although, I love myself some worcestershire sauce too, and that has fermented fish in it, so maybe there is a correlation.
I don't know if anyone in here has read the book "Electronics for Earthlings"
but it makes tons of references to lutefisk
 
8:07 PM
@Josh Yup -- both so nasty smelling I can't get close enough to actually eat either one.
 
@JerryCoffin Do you like Fritos? They have the same effect on me. I know they taste ok, but they smell horrible.
 
@Josh Thankfully, no. They don't bother me nearly as much, but I don't particularly care for them either.
 
Petrol? I think that smells great :)
 
@Josh Hmmm...electronics for earthlings must mean Lutefisk is for aliens...
 
Explains why they thought adding lye to dried fish was a good idea...
 
8:10 PM
It's a great book, actually. I helped my daughter learn basic electronics. She would actually look forward to it and ask me to read it to her at night.
 
electronics hmmm...
I did try to study that once...
got really confused
:(
 
@TonyTheTiger I do think the basic stuff is much harder in electronics, because it's not very intuitive. People tend to use water analogies a lot, but those really becoming damaging pretty quickly if you really want to understand what's happening.
 
hmmm yea
I understand the very basic stuff, like volts and amps but when it get's into transistors I get a bit muddled
 
@TonyTheTiger He goes into those, as well as the principles behind them. You just don't know that until he tells you that's what he was talking about, and then the light turns on. That happens a lot in he book.
For reference, I am in no way associated with this book :)
 
hey guys
what do you think of ditching the old class x { .... } syntax?
 
8:21 PM
With what to replace it?
 
I have features in "DeadMG++" that permit creating and manipulating types as objects at compile-time
you can already do things like type t; t.public_functions.add(...);
the reason I was thinking of ditching it is, quite frankly, I might have fun trying to parse such things
 
@Josh oh cool
@DeadMG DeadMG++ eh? Sounds cool!! :P
 
lol
I will need a new name before long
 
@DeadMG You want to remove something because you think it would be fun to implement it? You lost me.
 
fun was being sarcastic
 
8:32 PM
ah
 
I want to remove it because I have perfectly equivalent functionality and I think that it would be difficult for me to parse
in fact, the other form is superior for a few reasons
 
Well, hey man, it's your language. Toss it out and don't look back.
 
I don't want to alienate people :(
 
weird
in this code, it is doing return typeid(1 ? *ptr : *ptr) == typeid(DerivedHandle);
 
@DeadMG your language, you can do whatever you like
 
8:34 PM
Well, I think it would be a mistake to make it similar just so you don't alienate people. I think if the language stands on it's own merit people will learn the syntax.
 
what's with that weird ?:?
 
that's true, I guess
 
@JohannesSchaublitb ternary operator?
 
@JohannesSchaublitb Polymorphic type being dereferenced?
 
but he's got the same code for both branches
 
8:35 PM
Wouldn't 1 ? *ptr : *ptr just be *ptr ??
 
@Josh: Bingo
 
@Josh yes! that I don't understand
why the weird stuff
 
?: can be used in very funky ways for metaprogramming, sometimes
 
@JohannesSchaublitb I think someone is fscking with you man
 
but that seems like a trivially removable case
 
8:35 PM
An attempt at avoiding a runtime typeid lookup? But why use typeid then?
 
are you playing us again @JohannesSchaublitb?
 
@LucDanton that ?: still returns an lvalue!
so what's up with it??
 
attempt
 
@JohannesSchaublitb again?
 
8:36 PM
lol
 
I know one thing this does accomplish
well, maybe
 
please speak out
 
it would prevent the compiler from resolving typeid at compile time and force a runtime resolution
 
a runtime resolution is forced anyway
 
unless the compiler was smart enough to recognize that the ternary state both always returns true, and that either branch is the same value
 
8:40 PM
if it's polymorphic
 
Looks like something familiar...
 
and removing ?: is a trivial constant fold which I would expect to be applied
 
Is the code trying some naive anti-reversing perhaps?
 
I find the number one thing a lot of people do is try to find meaning where there is none
the guy who wrote the code fucked up, it's as simple as that and no more and no less
 
Perhaps they were sprinkling in stuff like this because they knew about opaque predicates ?
@DeadMG No, it's not a mistake. It was intentional. Either @JohannesSchaublitb is intentionally messing with us, or there is something there.
 
8:43 PM
@DeadMG actually I made it up. and there is a specific use case for it xD
 
what is that use case?
 
Well, out with it man. It looks like an opaque predicate. But why? Too fool the compiler or a human?
 
that's the question
lol
 
the answer might be interesting
trying to guess it definitely is not
 
@DeadMG Speak for yourself - I'm sure @JohannesSchaublitb is enjoying the guessing game.
 
8:46 PM
@Johannes: If you know that there's a specific use case, then why did you post an SO question on it?
 
@DeadMG That's your first mistake. The less you try to alienate people, the more it'll end up as a cross between BASIC and COBOL. Especially any more, you have to start with at least one utterly alien concept (e.g., functional programming) and preferably alien syntax as well (a cross between Lisp and Haskell, perhaps) to get noticed at all. Make it unreadable and unpronounceable, and you'll have a winner.
 
@DeadMG Looking at his history it looks like this might not be the first time a question has been posed that was crafted. I don't see that as a bad thing - some of them look pretty insightful.
 
@DeadMG because I found I may be wrong on the use case
 
why not just post the use case and actually ask people the question you want answered then?
@Jerry: I have other things to attract people to my language :)
 
So for home defense, 9mm or .45?
 
8:51 PM
45mm.
 
the fact you have to ask makes me suggest that you move your home
 
@CatPlusPlus 120mm is better.
 
@Josh six-barrel, 20mm Gatling cannon (1200 rounds per minute).
 
@DeadMG ah gcc doesn't pick it up. but clang does!
 
@JerryCoffin I don't think you would have much home left to defend in that case.
 
8:53 PM
i suspect one would need an intermediary function call for gcc
 
@Josh Don't fire towards the home, sillly.
 
@Josh You mount it on the outside. Definitely don't want it inside or pointed toward the house, because yes, it'll saw a house in half without even trying.
 
@CatPlusPlus Ah of course, I missed that. My mind was busy thinking about what ground vehicle has a 20mm cannon in it, and how I would fit an aircraft in my house for purposes of home defense. My bad :P
@DeadMG Perhaps my house is in a safe location, but there are other reasons why I would be asking.
 
true
 
@Josh Get an attack helicopter.
 
8:56 PM
@EtiennedeMartel Now you are talking. One with a helmet mounted, optical tracking sight.
Robbers? Pfft. Robbers with a chobham armored Challenger 2? Pfft, I say.
 
@Josh I don't know about ground vehicles, but back when I worked on B52's, that's what the B52H used as a tail gun (a major step up from the B52G and earlier, which had a 4-barrel, .50 cal (though it did 1500 rounds per minute). OTOH, only one B52 is known to have ever shot down an enemy fighter with its tail gun, and that was a B52D.
 
@Josh And an aircraft carrier on standby can also be useful in case those pesky criminals get creative.
 
@JerryCoffin Nice. I don't know why the US clung to .50 on aircraft so long. I think we finally learned our lesson when the sabres in korea would hammer MiG 15's with a few hundred rounds to down them
 
@Josh My immediate guess would be NIH -- anything measured in good old inches just had to be better. Those millimeters were undoubtedly a socialist conspiracy.
 
@EtiennedeMartel Packed full of Rafale's right?
@JerryCoffin Sounds pretty American to me :)
 
9:01 PM
@Josh And by the way, did I mention that the only liquids I consume are rain water and grain alcohol? :-)
 
@JerryCoffin So, you are russian?
 
wow, how did we get from electronics to aircraft and weapons?
 
Isn't this normal?
 
@TonyTheTiger Because this chatroom's population is mostly male.
 
9:03 PM
@EtiennedeMartel then women should be a subject of conversation too :)
 
Listen, C++ is turing complete, right? Wouldn't that include electronics and aircraft in it's problem domain?!
@TonyTheTiger Last time we talked about women in this chat some some poor chap said that his "interactions" with women were like an early return statement.
 
@TonyTheTiger Yeah, that's probably the next one on the list
@Josh Ah, right, I forgot we were programmers.
 
@EtiennedeMartel Yeah, but the only programmers who get the chicks are the guys who code assembler.
Legend has it anyways.
 
Nope.
 
9:05 PM
The F-35 runs on C++
 
@Josh Hmm...I take it you've never watched Dr. Strangelove? But no, I'm not Russian (though my ex-fiance is).
 
@EtiennedeMartel Nice. I bet those are some stringent, over engineered standards.
@JerryCoffin I have, sorry I didn't get the reference. Great movie though!
@EtiennedeMartel I bet it uses WindRiver's vxWorks too.
@CatPlusPlus You must be one of those guys who grew up with a flat memory model and never dealt with 2 letter registers, then :P
 
@Josh Of course, I may have mangled the reference -- it's been a couple of years since I saw it, and my memory doesn't seem to be improving with age either (and I'm allowed to feel old, it being my birthday today...)
 
I don't remember any quote about rain water either tbh :(
 
@Luc: I've started a new question on literals.
 
9:09 PM
@JerryCoffin Snap, happy bday. What the deuce are you doing in a C++ chat on your bday?
 
@JerryCoffin Happy Birthday!
@KerrekSB Hi!
 
There's even a whole world of R strings which I didn't touch upon.
Hi! Birthdays? Happy birthday!
My biggest worry is this: char16_t x = u'\U0010FFFF';. What happens?
 
@JerryCoffin Hot damn, hoppy borthday!
 
@Josh Two letters? You got two letters? Why would you need more than one letter? A, X, & Y should be plenty for anybody.
 
@JerryCoffin 6502?
 
9:10 PM
@Josh Thank you all.
 
@JerryCoffin As a side note, I don't know how bad it is up there in CO but we've been >100F for several days in MO
 
(The only assembly I've ever done was SPARC v8)
 
@EtiennedeMartel Yup.
 
warning: character constant too long for its type
 
@JerryCoffin Gulps
 
9:11 PM
Compile-time diagnostic, the best kind of diagnostic.
 
@Josh Not as bad, but still 90+ every afternoon. The good point is that it gets down to ~60 at night, so as long as I open the windows at night and close them during the day, the house stays fairly decent.
 
But that's not telling me whether that's a truncation, because 0x10FFFF doesn't fit into 16 bits, or whether there is some effort to create a surrogate pair.
 
@EtiennedeMartel Yup. 6502. One processor to rule them all and in the ...nah!
 
@JerryCoffin Wasn't that in the original Nintendo?
 
@KerrekSB Well I believe in this instance the warning is there because of non-conformant code.
 
9:13 PM
@JerryCoffin happy birthday xD
 
@Josh Probably. Definitely in the original Apple, Apple II, Commodore PET/VIC 20/64, the Atari 400/800, etc.
 
@JerryCoffin And the B52?
 
@JohannesSchaublitb Thank you sir!
 
@Kerrek btw in your question, narrow and wide literal are not 'no semantics'. They are associated with the narrow set encoding and wide set encoding, respectively, which are implementation defined.
 
They're not required to be any sort of "encoding", though.
 
9:15 PM
Well, yes.
 
Well, the word "encoding" is never needed.
 
@Josh The 6502 is old, but not quite that old. I believe the last B52 was built in 1960. Military aircraft also continued to use vacuum tubes well after the rest of the world switched to transistors because they're more resistant to EMP.
 
Just that every character can be represented as one wchar_t.
 
@JerryCoffin Yeah, I meant it in a facetious way :)
 
This is curious: const char x[] = u8"\U0010FFFF"; has size 5, but const auto x[] has size 4.
 
9:16 PM
@KerrekSB 'a' != 'b' and static_cast<char>(static_cast<int>('a')) == 'a', how is there not an encoding from a numerical value to a symbol?
 
@JerryCoffin So, you used to work on b52's, you know crypto, you write software, you know assember, in your 40's.... you sound like a defense contractor!
 
@Josh Yeah, I figured that, but I can misinterpret with the best of them...
 
@EtiennedeMartel hehe
 
So I'm totally confused whether there is any actual byte stream transformation happening with those literals.
@LucDanton I suppose.
 
@KerrekSB const auto x[] = won't compile for me.
I don't think it's allowed.
 
9:19 PM
Sorry, const auto z = u8"...";
 
Well that's a pointer. So you get the size of the pointer.
Try auto&&, you'll get the same size.
 
@Josh Your forgot the "live in Colorado Springs", part, which also fits with defense contracting. Despite all that, however, nope, I don't do defense work. The last work I did for the DoD was on March 23, 1988 (I day I celebrate more than I do my birthday!)
 
Oh. Interesting. The rvalue reference binds to the array?
 
@JerryCoffin Ah ok. But you did... so my spot the fed sense isn't completely broken...
 
Type deduction + rvalue reference = perfect reference, as I call them. You get perfect forwarding in any case.
So no, decltype(z) would be an lvalue reference due to perfect forwarding rules.
Can you replace those 'no semantics' with '[narrow|wide] encoding, implementation defined' or some such? :)
 
9:22 PM
@LucDanton This went right over my head. Does decltype(z) give char[5] then?
OK
 
Peace out everyone - it was fun!
 
Can I say "byte string" for char?
 
No, const char(&)[5]
 
"Byte" being the smallest allocatable unit of memory?
 
@Josh Not broken, just a few decades off. Then again, working on B52s is pretty much a dead giveaway. Despite their age, at least when I was working on them, there were parts that had to be hidden from anybody who didn't have at least a Secret security clearance and the infamous "need to know".
@Josh Later.
 
9:24 PM
@LucDanton To confirm: auto && z = "Hello"; makes decltype(z) into const char(&)[N]?
Phrrr.
 
@KerrekSB I don't have a problem with it. I like the sound of 'octet' what with it being the native term for me but it sounds somewhat pedantic/dated in English.
 
Also you'll conjure the ire of the CHAR_BIT community
 
@KerrekSB Yes. Do you understand perfect forwarding?
 
Sort of. I know that as soon as you give it a name it's an lvalue...
 
@KerrekSB yes
 
9:25 PM
What? No.
 
And that std::forward is the only function that's sensibly allowed to return an rvalue reference.
 
enum A { X };. X is a prvalue
 
No, no, no.
 
template<int A> struct Lulz { }; A is a prvalue
 
std::move & std::get are quite sensible I'd think.
 
9:26 PM
Wait, I'm editing. One thing at a time.
 
Ah, yes, I did manage to find something.
 
auto &&x = alias<int[]>{1, 2, 3}; for the nudists
 
OK. I don't want to hear about pr and px values.
 
@JohannesSchaublitb Not familiar with alias
 
Isn't "rvalue" enough?
 
9:29 PM
Depends on the context.
 
template<typename T> using alias = T;
 
I'm more concerned about ostensible character literals expanding into sequences of characters.
@JohannesSchaublitb Weird! What good is that?
 
@JohannesSchaublitb That's funny then, I was wondering about prvalue arrays not so long ago.
I'll show that to Marthinho!
 
Are there any strlen functions for char16_t* etc?
 
lol
@KerrekSB then alias<X> will be type X
 
9:35 PM
Yes. What good is that?
 
typedef alias<int()>* how_convenient;
 
you cannot say int[]{1, 2, 3} but alias<int[]>{1, 2, 3} is syntactically allowed
 
Ah: u8'\u00F6' says: "warning: multi-character character constant". Nice!
 
you could say template<typename T> using pvector = vector<T*>; too
pvector<int> vector of int pointers etc
 
Can you say (int[]){1,2,3}?
 
9:36 PM
no :)
that's c99 compound literals
 
That's cast notation.
 
I see. So you can trick the compiler with aliases?
 
I mean, this is a situation where there is really no spelt-out version?
 
template<typename T> using ref = T&; then you can say template<typename T> void f(ref<T> r); and f(x) will still work
 
9:37 PM
Wait, didn't you suggest some syntax for a conversion operator to function pointer type not long ago?
 
because T is deducible
 
operator alias<int(*)()>() const;
 
@LucDanton yeah I suggested that to usenet
 
I meant Kerrek, on SO.
 
oh i see
@KerrekSB yeah you cannot spell it out without a typedef or identity<T>::type or alias template
@LucDanton also with template<typename T> using nondeduced = typename identity<T>::type; it becomes really convenient to say nondeduced<T> as a parameter type of a template
to have it nondeduced
 
9:41 PM
I haven't found the need for non-deduced parameters very often TBH.
@KerrekSB What about helping with that:
6
A: C++ Conversion operator for converting to function pointer

Kerrek SBSince you must know: (*operator int() const)(int, int) { return _funcPtr; } (Fixed. Again.)

 
@LucDanton Yeah, but that was easy to spell out, compared to all this stuff you are talking about :-)
 
But I'm not sure it's legal tbh!
 
(I lost an answer earlier and now I can't get it back :-( )
@LucDanton What's not legal?
 
The syntax for your operator.
 
Very legal :-)
 
9:46 PM
(*operator int() const)(int, int) is not legal syntax
 
@JohannesSchaublitb Hmm... I got no warnings even with the strictest options in GCC... why is that?
 
Because parsing C++ is hard!
 
@KerrekSB well it's difficult for me to find a direct quote or a simple expanation in the spec. but the spec says that a function having the name operator conversion-type-id, then "Such functions are called conversion functions. No return type can be specified. If a conversion function is a member function, the type of the conversion function (8.3.5) is “function taking no parameter returning conversion-type-id”."
so if anything, your function definition would define a function that simply returns int. and not a function pointer.
the surrounding (* ... )(int, int) is what would modify the return type.
the spec says for conversion function " No return type can be specified. ". i suspect that is intended to rule out both a type in the decl-specifier-seq that would preceede the name, as well as the modifiers like (* ... )(int, int). because both are just ignored for determining the type of the conversion function. only the conversion-type-id is respected
 
So am I in fact returning something else?
 
i suspect gcc makes it return int really. but I've not tried.
since you apparently tried, and apparently it compiled, it would have returned a function pointer tho.
i will try with clang
 
10:00 PM
Cool. It's definitely working for me on GCC.
Do you agree that it should work with a typedef?
Because it's really just unwrapping the typedef.
 
clang says main1.cpp:2:5: error: must use a typedef to declare a conversion to 'int (*)(int, int)'
 
@KerrekSB What was your previous attempt doing btw? I know it compiled because I tried but never examined the results.
 
It's working correctly on GCC, i.e. it calls the right function: int(*g)(int, int) = x; return g(2,3);
Here x is the object with the conversion function.
Clang seems to be useful.
Why don't you add that as a comment?
 
If there are two syntaxes for this then I believe it's a good hint that there is something fishy going on.
 
Or shall I?
 
10:04 PM
yeah
 
OK. I added a typedef-wrapping helper struct.
Is it legal now?
 
bow R, A1 and A2 are non-deducible xD
 
Template aliases are different than metafunctions in this respect.
 
10:22 PM
wow, I just received an invite for SO careers
apparently, this is due to my impressive 16 points in
 
10:47 PM
Ah, \uDB00: error: \uDB00 is not a valid universal character. This really is Unicode, not just some string of values.
 
@KerrekSB Context? String literal or char literal?
 
Both
Universally
 
Or is DB00 a Unicode special value?
 
It's a surrogate
 
Oh okay. Yes Unicode is spelled out in the Standard.
 
10:50 PM
So that's the answer: \uXXXX and \UXXXXXXXX always designate Unicode codepoints, semantically.
 
Right.
It's neato heh?
 
And they get transformed into the appropriate recepticle:
Let's assign \U0010FFFF:
char[]: F4 8F BF BF 00
 
It's like we're really using a modern, Unicode-aware programming language ;)
 
wchar_t[] on Linux: FFFF1000 00000000
char16_t[]: FFDB FFDF 0000
char32_t[]: FFFF1000 00000000
@LucDanton Yes!
Now I don't know why we'd need the u8 length modifier, though.
 
Come again?
 
10:52 PM
Oh, also it seems that any non-surrogate value is an allowed codepoint, even \U00200000.
Well, there's also the u8"Hello" literal. Why?
 
You mean what's the difference with narrow set literals?
 
Well, it seems to behave the same as just an unprefixed literal
there's no separate char8_t
 
Now imagine you're on an EBCDIC platform.
The type is the same, the encoding isn't.
Think (type, encoding) pair, always.
In fact it's even possible to convert from e.g. (char32_t, UTF-32) to (char, UTF-32) IIRC.
Lookup wstring_convert, this is a really obscure part of the Standard library to me but there is stuff in there.
 
Err... I don't get it. I can say "\u0030" and I get an ASCII 0. I can also say u8"\u0030" and I get the same ASCII 0.
What's the difference?
If I say "0" and u8"0", that's equally platform dependent
 
"0" won't be ASCII 0 on an EBCDIC (well I assume I don't know EBCDIC that well.
 
10:58 PM
The point is that when I input a literal with the \u/\U acrobatics, I get a definite value.
 
Right
 
No, but neither will u8"0".
 
Mmmh
Let me check that.
 
The thing is that you have no control in general over the relation between the source code file encoding and the literal values
 
> A string literal that begins with u8, such as u8"asdf", is a UTF-8 string literal and is initialized with the given characters as encoded in UTF-8.
We have to check the meaning of 'given characters' right?
 
10:59 PM
Yes!
 

« first day (279 days earlier)      last day (4660 days later) »