THE BAD IDEAS THREAD
-
@lb_ Did you really intend the operator T() to be
noexcept
? Or is that just copy-pasta? (Right now it will juststd::terminate()
...). Still, interesting idea.However, in today's episode of C++ is special:
Never
only has deleted constructors, so it should be impossible to create aNever
. But:Never f() { return Never{}; }
compiles. ;-)
Edit: Probably also should throw something in the general case, not just rethrow.
-
@cvi IIRC, that makes that
throw
proceed directly to Crash, not passing Go and not collecting $200.
-
@cvi I wanted it to be
constexpr
but you can't usestd::declval
there, so I just usedthrow;
which is allowed in constexpr functions. The function can never be called anyway unless you do somereinterpret_cast
shenanigans.I don't know why that
return Never{};
compiles but my best guess it that it may be a compiler bug: the compiler sees that there are no constructors inNever
and treats it like an aggregate type. In which case all my testing with it is unusable since we have no idea whether this is actually supposed to work this way or not. Good thing we're in the bad ideas thread!EDIT: MSVC gives
error C2677: binary '&&': no global operator found which takes type 'Never' (or there is no acceptable conversion)
so clearly something fishy is going on here. When I try yourreturn Never{};
fuinction it giveserror C2280: 'Never::Never(Never &&) noexcept': attempting to reference a deleted function
which is even more confusing.Definitely seems like this type is triggering some unusual behavior in both compilers.
EDIT: I added a new constructor and somehow that made the
return Never{};
stop compiling: https://godbolt.org/g/397jqEtemplate<typename... Args> constexpr Never(Args &&...) noexcept = delete;
It still works with the original demo in GCC, no idea if it's supposed to or not :D
-
@lb_ said in THE BAD IDEAS THREAD:
I wanted it to be constexpr but you can't use std::declval there, so I just used throw; which is allowed in constexpr functions.
Not sure I follow - you can
throw
anything in there. It will produce a compile-time error if you do so from a constexpr context (otherwise it will just throw the thing). Now you'll end up callingstd::terminate()
if you're outside of acatch
(and not in a constexpr context).I don't know why that return Never{}; compiles but my best guess it that it may be a compiler bug:
No, not a compiler bug. You're right about the aggregate initialization, though -- I saw some discussion that this should be considered a language bug. You can work around it by defining one or more private members, in which the aggregate initialization is no longer possible.
When I try your return Never{}; fuinction it gives error C2280: 'Never::Never(Never &&) noexcept': attempting to reference a deleted function which is even more confusing.
Ok, I get the same under C++14 (and earlier). C++17 has the mandatory copy elision, which omits both copy- and move-construction in this context. MSVC doesn't seem to implement that yet.
Edit: Yeah, that constructor of yours is probably a better idea than adding private members, and should do the trick.
-
@dkf said in THE BAD IDEAS THREAD:
IIRC, that makes that throw proceed directly to
Crashstd::terminate(), not passing Go and not collecting $200But ... at that point you might just call
std::terminate()
directly...
-
@cvi said in THE BAD IDEAS THREAD:
Not sure I follow - you can
throw
anything in there. It will produce a compile-time error if you do so from a constexpr context (otherwise it will just throw the thing). Now you'll end up callingstd::terminate()
if you're outside of acatch
(and not in a constexpr context).Well the only way to call
operator T
is to have aNever
object, which is supposed to be impossible. No point throwing an exception that is impossible to be thrown! Also it'snoexcept
to future-proof fornoexcept(auto)
-
@lb_ Fair enough.
Although:
@lb_ said in THE BAD IDEAS THREAD:
which is supposed to be impossible
Supposed? Hold my beer. ;-)
@lb_ said in THE BAD IDEAS THREAD:
Also it's noexcept to future-proof for noexcept(auto)
I still think you could just call
std::terminate()
there, instead ofthrow
(seems to work for both GCC and MSVC -- since terminate isn't constexpr, this will just cause a compile-time error if you try to use it in a constexpr context). The fact that there's a noexcept function whose body is a singlethrow
seems ... wrong to me.
-
-
@cvi said in THE BAD IDEAS THREAD:
I still think you could just call
std::terminate()
there, instead ofthrow
(seems to work for both GCC and MSVC -- since terminate isn't constexpr, this will just cause a compile-time error if you try to use it in a constexpr context). The fact that there's a noexcept function whose body is a singlethrow
seems ... wrong to me.Oh right, because it's a template that's possible. However the standard requires that at least one possible instantiation of a constexpr template actually be valid. Clearly that's not enforced in practice, though.
-
-
-
-
-
@boomzilla said in THE BAD IDEAS THREAD:
"Don't worry about that. The hungry lions we're releasing next will deal with those ostriches..."
-
Today in the news I read about a bad idea someone had: A few people wanted to be creative with their wedding present and put a bunch of 500 SEK bills in a helium balloon. They also did not tell the couple what was in the balloon when they handed it over. And of course the obvious happened: the playmobil diorama the balloon was fastened to broke and the balloon took to the skies and soared away with all the money inside. Shame I don't live anywhere near where it happened or I may have had some sudden inspiration to go for a walk in the forest...
-
@ben-l A talking-dog remake of "Full Metal Jacket" called "All Dogs Go To Hell".
-
(also why is the link preview in French?)
-
@anonymous234
That's not French, that's modern Arabic
-
@izzion said in THE BAD IDEAS THREAD:
@anonymous234
That's not French, that's modern ArabicThere's an immigration joke to be had there.
-
@boomzilla said in THE BAD IDEAS THREAD:
Carjacking a car with a manual transmission. But you only know how to drive an automatic.
Probably not unusual. My niece was carjacked, but they gave up and ran away when they realized it was a standard.
-
-
@boomzilla said in THE BAD IDEAS THREAD:
It looks comfortable. I'm sure I'd get seats on the subway if I wore it.
-
-
@tsaukpaetra the vagina dress doesn't make you look like Gumby though.
-
@boomzilla said in THE BAD IDEAS THREAD:
@tsaukpaetra the vagina dress doesn't make you look like Gumby though.
True. I probably wouldn't fornicate with Gumby either.
-
@tsaukpaetra said in THE BAD IDEAS THREAD:
@boomzilla said in THE BAD IDEAS THREAD:
@tsaukpaetra the vagina dress doesn't make you look like Gumby though.
True. I probably wouldn't fornicate with Gumby either.
The lady wearing the Gumby suit and the lady wearing the vagina dress both look eminently fornicatable to me.
-
@dkf said in THE BAD IDEAS THREAD:
"Don't worry about that. The hungry lions we're releasing next will deal with those ostriches..."
I know an old lady who swallowed a fly...
-
@tsaukpaetra said in THE BAD IDEAS THREAD:
True. I probably wouldn't fornicate with Gumby either.
But Pokey...
-
@boomzilla said in THE BAD IDEAS THREAD:
@tsaukpaetra said in THE BAD IDEAS THREAD:
@boomzilla said in THE BAD IDEAS THREAD:
@tsaukpaetra the vagina dress doesn't make you look like Gumby though.
True. I probably wouldn't fornicate with Gumby either.
The lady wearing the Gumby suit and the lady wearing the vagina dress both look eminently fornicatable to me.
Sure. But I said Gumby himself.
Maybe if he did something about that gritty dirt feeling...
@blakeyrat said in THE BAD IDEAS THREAD:
@tsaukpaetra said in THE BAD IDEAS THREAD:
True. I probably wouldn't fornicate with Gumby either.
But Pokey...
I'll put that on the "maybe" section.
-
@tsaukpaetra What about Gumby's MILF mom:
Oh yeah.
-
@blakeyrat said in THE BAD IDEAS THREAD:
@tsaukpaetra What about Gumby's MILF mom:
Oh yeah.
So we're down to the level of objectifying objects. I have no words...
-
@boomzilla said in THE BAD IDEAS THREAD:
Looks like she decided to wear the curtains. But who would own curtains that garish?
-
@pleegwat said in THE BAD IDEAS THREAD:
Looks like she decided to wear the curtains.
Goddamned that was a funny Carol Burnett skit:
-
@karla said in THE BAD IDEAS THREAD:
@boomzilla said in THE BAD IDEAS THREAD:
It looks comfortable. I'm sure I'd get seats on the subway if I wore it.
As long as you don't mind looking like a fat pink Gumby.
-
@anotherusername said in THE BAD IDEAS THREAD:
@karla said in THE BAD IDEAS THREAD:
@boomzilla said in THE BAD IDEAS THREAD:
It looks comfortable. I'm sure I'd get seats on the subway if I wore it.
As long as you don't mind looking like a fat pink Gumby.
I've been called worse.
-
-
@luhmann Fat pink Pokey.
-
@luhmann said in THE BAD IDEAS THREAD:
@karla said in THE BAD IDEAS THREAD:
I've been called worse.
A skinny Gumby?
Never.
-
@blakeyrat said in THE BAD IDEAS THREAD:
Pokey
TIL
I initially thought this was a Pokemon reference...
-
@karla WATCH AND LEARN:
https://www.youtube.com/watch?v=aCKgKXpSGys
OR DON'T I GUESS.
Also see the "sequel" skit, Bolus and Horseflop:
https://www.youtube.com/watch?v=UGxgFaMu8jM
WORK THE LUMPS MIKE!
-
-
@boomzilla When I look at her, I hear a different "Call of Duty"
-
-
-
Someone should track the sustainability of GODDAMNIT FBMAC. There are 10+ year old topics around, but they're not being created as quickly as new posts because topics tend to have more than one post in them.
-
@ben_lubar just generate the cutoff value into the css based on the current metrics and your desired occurrence rate.
-
@ben_lubar it's rapidly dropping since your post. I think people are trying to claim the last few in the wild as trophies.
-
-
Do yourself a favor: Click through and read the entire thread.
-