« first day (2354 days earlier)      last day (2595 days later) » 
00:00 - 11:0011:00 - 00:00

11:00 AM
@ratchetfreak You just said that "checking A based on B requires access to A." Yes, isn't that right?
where A = "template definition" and B = "template parameter constraints"
@ratchetfreak And the answer to that is yes, template parameter checking according to predicates can be accomplished through SFINAE and static_assert
@ratchetfreak It's used for boost::variant. <type_traits> is an example of a header file that includes template type-checking predicates that can be used to check the properties of types at compile-time.
 
@VermillionAzure that's not what I'm getting at. I'm asking that if you do A a; a+=2; with A a template param; can you automatically check that the constraints guarantee that the operator+=(int) is available. Without explicitly doing the check.
 
@ratchetfreak Doesn't template substitution already do that?
 
that's what I mean with semantic checking of template definition
@VermillionAzure before it ever instatiates
 
@ratchetfreak Yes, apparently this is possible.
39
Q: How to check whether operator== exists?

BЈовићI am trying to create an example, which would check the existence of the operator== (member or, non-member function). To check whether a class has a member operator== is easy, but how to check whether it has a non-member operator==? This is what I have to far : #include <iostream> struct A { ...

Checking whether an operator exists can be checked with SFINAE.
 
without explicitly doing the check for operator+=
 
11:08 AM
@ratchetfreak How are you supposed to check for the existance of something without explicitly checking for it somewhere?
Whether that's in a manual template SFINAE thing or a composite class that wraps it up for you and does it as a part of its static_assert checking, it's going to happen.
@ratchetfreak If you can program a predicate for it in templates, you can use it with static_assert to get the checking at compile-time.
Concepts are sugar that's supposed to make the process MUCH MORE simple, but it is still possible and achievable, nevertheless.
 
If I rephrase: I want a check of the definition so that I'm sure that for any set of parameters that satisfy the constraints the template will substitute in without error.
 
@ratchetfreak Isn't that exactly that static_assert combined with template predicates is?
Any set of types that are passed into the template and passes the static_assert checks is valid according to the encoded semantics in the compile-time predicates.
 
but you could still accidentally use a copy constructor without checking for it to be available
 
e.g. Foo<T> such that T is copy-constructable can be checked with static_assert(std::is_copy_constructable<T>::value, "Error: T is not copy constructable in Foo<T>").
@ratchetfreak Duh. You need to check for it if you want to check for it.
Constraints need to be asserted. That's like saying "requirements must be stated."
 
@VermillionAzure and that's my problem
 
11:15 AM
@ratchetfreak How is that a problem?
That doesn't mean that C++ is incapable. It just doesn't hand it to you on a platter.
Which, of course, I agree is not in the best interest of productivity, but it is objectively possible.
 
I want that check to be automatic without needing to manually add everything used in the definition as a constraint in the declaration.
 
Ell
@VermillionAzure well not really asserted
 
@ratchetfreak Then use enable_if.
 
Ell
They need to be stated somewhere
"This thing needs to be copy constructible"
 
@Ell yeah.
 
Ell
11:20 AM
@VermillionAzure but ratchet is implying he wants concepts already I think :P
 
@ratchetfreak Actually, that is impossible in C++.
 
@Ell Everybody wants concepts, but some people think that enable_if can do the job. It can, but it's ridiculous.
 
Ell
He also wants definition checking or whatever it's called
Which concepts won't even support
 
@Ell Well, it might already be supported.
 
@VermillionAzure Because SFINAE doesn't look past the declaration, something like bool operator==(T const&) { static_assert(false); } will pass a SFINAE check for x == y, but still invariably fail when actually used.
 
11:22 AM
@Ell but having that would make writing template code much simpler and less error prone
 
E.g. struct foo { foo(foo const&) { static_assert(false); } }; static_assert(std::is_copy_constructible<foo>()); compiles fine, but it's impossible to actually copy-construct foo.
Wait, not like that.
I forgot what the bad case is.
 
@R.MartinhoFernandes Well, the compiler stops at the definition though.
 
@VermillionAzure Right I forgot to make it a template.
This ^
 
Ell
@ratchetfreak yeah, I agree
 
@ratchetfreak Well, agreed.
That's why everyone wants concepts.
@R.MartinhoFernandes Oh that's just weird.
@R.MartinhoFernandes But if you bring it out into the struct definition, it works correctly.
 
11:34 AM
if C++ had it from the start the current mess wouldn't be there, and type-erased template implementations need to have it.
 
@VermillionAzure That's not the same code.
 
@ratchetfreak C++ didn't HAVE templates at the start, dude.
 
@VermillionAzure The writer of the struct clearly doesn't want all foo<T> to be copy-constructible so it makes zero sense to assert it.
 
@VermillionAzure at the start of templates
 
@R.MartinhoFernandes Right. But you can get what you want. I wonder why it works like this but not in your example: coliru.stacked-crooked.com/a/1403fb35997c9844
@ratchetfreak Bjarne has already expressed that templates was a mistake on his part, if I remember.
 
11:36 AM
@VermillionAzure No, that's not what you want. The struct is not default constructible now.
 
@R.MartinhoFernandes But you also need to cut the guy a little bit of slack for creating only one of the most influential languages in the world.
 
@VermillionAzure In fact, foo<int> is now just not usable at all. The original was perfectly fine as long as you didn't try to copy it.
 
@R.MartinhoFernandes You can't even create foo<int> f; in main because the default constructor is not defined.
 
@VermillionAzure I.e. if your solution involves changing what the original code did, it's not a solution.
@VermillionAzure But if you define it, it's fine. (I didn't for succintness)
 
@R.MartinhoFernandes And if the author wants to do that, isn't Foo(const Foo&) = delete; more idiomatic?
 
11:37 AM
@VermillionAzure Again, that doesn't do the same.
Now no foo<T> is copy-constructible.
 
Ugh never mijnd.
 
I'm tired of arguing.
 
@VermillionAzure That'd break this coliru.stacked-crooked.com/a/81b3a7b8bbceeb79
@VermillionAzure Also note that when I say "not usable at all", there's no exaggeration. You can't even use it with std::is_copy_constructible: coliru.stacked-crooked.com/a/8fc1d9bd81ccd293. This doesn't compile at all, as opposed to returning a 0 (coliru.stacked-crooked.com/a/206777622c897701).
 
@VermillionAzure they are in effect type safe macros
 
12:09 PM
> type safe macros
blinks
 
@SpongyFruitcake SFINAE helps to fix this issue but it is a fundamental issue of the template system that concepts is intended to fix.
 
you mean concepts of not-C++17
 
like macros they produce arcane and near indecipherable error messages
 
12:53 PM
the reason why you should not feed local wildlife
but this bird comes to the kitchen window and begs for food everyday
often succeed
 
meanwhile in Ukraine:
 
I've seen pigeons so heavy that they couldn't fly anymore.
Or barely fly anymore.
 
Ven
do a pigeon roll
 
user1804599
 
Ven
he's worse than them vOv
 
 
1 hour later…
2:36 PM
I want honest opinion:
would you associate bar or store with food?
I mean, if you are searching for a bite, and there is a bar or a store on your GPS without any other info, would you go there for food?
 
I think the chances are higher that you get something to eat in a store than in bar. Then again it depends on the kind of store >.<
 
 
I could find it out by writing a script or I can save 2 days by using common sense (and possibly get it wrong)
 
3:16 PM
@Feeds Sometimes I mispronunce "pronounciation"
 
@milleniumbug And sometimes you misspell "pronunciation".
 
Ven
Wtf is english even
 
@Ven A misspelling (or mis-capitalization, anyway) of "English", obviously. :-)
 
@JerryCoffin yeah, given the two misspellings in my post, that's the joke
 
@JerryCoffin I always thought it meant that something was very engli-like.
 
3:28 PM
@StackedCrooked You're probably right (and being an ignorant Merkin, I didn't realize it). :-)
 
Hi, all. Looking for some references to learn C++...again. I've learned it twice now, both prior to and after its initial standardization. I used "Accelerated C++" to learn the initial standard. What are the "standard" go-to books to learn C++ these days?
 
@Allen Unfortunately, there's nothing similar to a more modern replacement for Accelerated C++.
 
That's unfortunate.
It was a good book.
 
user1804599
3:42 PM
A tax disclaimer after each airing on state television and radio. "Making this programme cost €…."
 
user1804599
That's a great idea!
 
user1804599
I want to know how much of my hard earned cash goes to propaganda against myself.
 
@Allen It is. At one point Andrew Koenig talked about writing an update, but said the copyright status was fraught. The copyright on the original belonged to AT&T, from before the trivestiture. It apparently wasn't seen as a big enough asset for the attorneys to clearly state which of the three pieces owned it afterwards.
 
@JerryCoffin make me wonder how many other things are in copyright limbo like that
 
@JerryCoffin Not necessarily looking for a replacement for that specific book, but just good, solid references to re-learn C++.
 
3:50 PM
Yes, it's working! I had to serialize the dimensions of V (i.e. N, M, S in V[N][M][S]), and then add to the constructor of X1 that takes data from the serialized V, also its dimensions. Can't upvote you having not enough reputation, but thank you! — expiring_noob 6 mins ago
IDGI. I have plenty of reputation :)
 
Ell
so we got constexpr if
is that the if that bjarne is not happy about?
 
that's a big if
 
nwp
@Allen the tour is intended to relearn C++, but it is not a solid reference
 
Xeo
4:21 PM
@Ell Bjarne (and a few others) weren't happy about static if (with all the additional crap it could do)
 
user1804599
How can you possibly be happy about adding new features to C++?
 
@nwp thnx
 
Ell
@Xeo how does that differ from constexpr if? they both do "don't compile this" don't they?
or don't they
maybe this page I was reading mislead me
 
Xeo
static if had a lot more attached to it
 
@Allen cpp reference is fairly good if you like to jump into things and explore the current standard. For more complex things, I find that videos from the various conventions talk in great depth about new features.
 
Xeo
4:32 PM
acting like enable_if at times, allowing declarations to escape the "scope"
 
5:08 PM
@ratchetfreak Comparatively few, I think. In most typical cases, the copyright is owned by the publisher.
 
Ven
@Xeo lolwut?
 
class A { static if(condition) typedef int something; } // here the declaration of something is in the class scope
 
Ell
ah I see
 
Ven
Oh :<.
 
@milleniumbug but there is nobody there :(
 
@trilolil Go to 4chan then. There are plenty of people over there.
 
@trilolil guess why
 
@Morwenn I have a serious question, I am not looking for some online jokes.
 
in this case you're in the wrong room
 
5:32 PM
@trilolil Exactly: you're not in the right place.
 
@trilolil This room is not for serious questions. The place to ask serious questions is:
 
I am speaking about the "C++ Questions and ..." room
@Mysticial you just want some extra reputation
 
you have the same chance of getting an answer here and there
 
lol
 
in fact, there is a slightly higher chance of getting an answer in the C++ Q&A room
 
5:35 PM
indeed I have been there a few times in the past and people were kind enough to help me out very quickly.
AFAIK my questions seem to not be too complicated.
davaite rebiata
 
5:54 PM
Huh. std::string Integer; and int String;. — HolyBlackCat 4 mins ago
/cc @Mysticial
 
6:13 PM
lol
@Borgleader Makes me wonder what will happen if someone write a bot that would post botany comments on every downvoted SO question.
 
Are the atoms just freely floating points? Then you could try std::atomic<float>. — Kerrek SB 1 min ago
 
@KerrekSB why are you trolling? — Armen Avetisyan 32 secs ago
lol
 
@Mysticial would get banned within minutes :P
 
6:30 PM
-62
Q: Provide 24*7 Online help centre facility

Jeba MosesMany programmers are struggling during their office time due to critical bugs and doubts. If you provide online immediate assistance it will save lots of developers careers and life too.

 
I'm both hungry and not hungry. What shall I do? :x
 
nwp
eat chicken
 
I wish.
 
@Morwenn try eating and not eating at the same time
 
@milleniumbug Thanks. I'll try that.
 
6:32 PM
also, I see you have a new avatar
 
Also I'll soon need to go play Pokémon Go.
 
not nude anymore
:P
 
@milleniumbug It happens from time to time.
@milleniumbug Hey, I wasn't nude D:
 
yeah, but I pretend you were
 
Truth to be told, I'l somewhat half-nude on this avatar too, but you can't see it.
 
6:33 PM
the other half now?
 
I would gladly share a photo of my awesome thighs, but it isn't C++ so it would be off-topic.
 
inb4 Lounge<Thighs>
 
x)
 
I'VE DONE IT
I've created a C++ dependency graph script.
 
Looks like I've somewhat become more confident with my body :D
 
6:41 PM
but I thought C++ was off topic here
wait
 
Oh right. Here goes the thighs photo then.
 
C++ is off-topic here. Non-C++ things are off-topic here. Therefore, everything in this room is off-topic.
:V
 
You're off-topic :p
 
inb4 flagged for nudity
 
nwp
lounge<meta> where only discussions about what is on-topic is allowed
 
6:43 PM
@Morwenn I am indeed off-topic
 
@milleniumbug Nah, I'm too shy.
 
aaaaah, you're teasing us :)
 
Well, I do have a photo, but I fear the almighty banhammer x)
 
@Morwenn Well, you didn't cover up your hair, so you're obviously subject to public stoning. Once you're already there, it doesn't make much difference how much more you show.
 
nwp
yeah, that might make a huge blue spot
 
6:48 PM
@JerryCoffin Cool, I like to get stoned with friends.
 
@Morwenn Yes, but you probably do it in private. Public stoning is entirely different. :-)
 
@JerryCoffin It's generally in the streets. I hate the smell of cold smoke.
 
nwp
@Morwenn Because of you I can't go pee because you might post the pic and then delete it.
 
@Morwenn Ah, I had no idea. Reminds me of a room-mate I had years ago. He had a couple of friend over, and they all did some acid. He'd wandered off, and none of them noticed until I got home and asked where he was (which they had no idea). I finally found him standing in the middle of the street, staring at a street light (and pretty clearly seeing a lot there that I didn't).
 
@nwp Don't worry about it, imgur doesn't want the photo x)
 
6:57 PM
@JerryCoffin It's Englisc :^)
 
@JerryCoffin I declined some LSD a few days ago. I don't really want to try acid.
 
@Morwenn I tended to feel the same way. In fact, that same room-mate threatened to dose me without my consent. I told him he could--but if he did, he'd better be at least a couple of states away, or have reserved a hospital room when I was sane again.
 
I'm so pale on that photo ._.
@JerryCoffin Against your consent? Well, now that's terrible.
 
@Morwenn He made rather a point of pointing out that he wasn't scared of me--but he never did it.
 
@nwp Plus, I'd never do that.
 
nwp
7:03 PM
@Morwenn I clicked it :P
 
I thought you'd be peeing D:
 
@JerryCoffin holy hell what a jerk
 
@JerryCoffin But would he be scared of you now? :p
 
Honestly there are some drugs I'm not against, but there are a lot I also choose to avoid. Most of the ones I avoid are the highly psychoactive or addictive ones.
 
@Aaron3468 I already lost to cheese. It's too late to stop now.
 
7:07 PM
I avoid all drugs that my doctors don't prescribe to me.
 
@Morwenn Oh god I know. Most of us in this room were C++ addicts at some point. It's a hell of a drug.
 
nwp
now that C++17 is basically out I want to pick my entity-component-system back up and play with all the new cool features
no modules that fix everything, but at least I get to remove the template hacks like apply and if constexpr workarounds
 
I hate trees
 
@Mysticial LOL
 
@Mysticial `\\?\` and the new pathing APIs are your friend on windows
 
8:00 PM
But I did it
 
Xeo
@Mgetz .NET says hi
also anything not using those APIs says hi.
 
8:12 PM
@Xeo .NET is fixing their crap on OS's that support it (Hint: all of them)
@Xeo can't expect old things to be using unicode pathing
 
Xeo
that so? All the info I found told me to P/Invoke the Unicode Win32 APIs
@Mgetz even new programs and libraries likely aren't doing it, out of habit or whatevs
 
Xeo
> You need to set a policy to enable the support.
whoo...
 
4.6.2 enables it by default
 
Xeo
Also, is 4.6.2 only on Win10?
 
8:20 PM
@Xeo no
 
Xeo
kay
That still means all programs and frameworks need to upgrade to 4.6.2 and use the new path specifier :>
 
@Xeo and?
 
Xeo
Which means I probably won't be able to use it for the foreseeable future.
15 mins ago, by Xeo
@Mgetz even new programs and libraries likely aren't doing it, out of habit or whatevs
 
your choice
 
Xeo
not if I don't want to reimplement ALL the things?
 
8:33 PM
@Xeo why? this should be a zero code fix
 
Ell
8:53 PM
@JennaSloan even paracetamol?
 
@Ell yup
 
Hello templates my old friends ♪ ♫
 
you all suck
8
that's my official standpoint
 
@Puppy ♥
 
9:11 PM
@Puppy Yup.
It helps increase our data intake.
 
9:26 PM
@Morwenn I have no idea. He moved away so I haven't seen him in over 20 years.
 
@JerryCoffin Oh, ok.
 
10:02 PM
@Morwenn I've come to instantiate you again
 
xD
 
 
2 hours later…
Ell
11:43 PM
@JennaSloan does that mean you don't take paracetamol ever or that you go to the doctor when you want it?
 
I mean .... I would like to argue that what's built between the US and mexico is a fence not a wall
do you know many see through walls?
American people have been lied to again, so it seems ... :x
 
00:00 - 11:0011:00 - 00:00

« first day (2354 days earlier)      last day (2595 days later) »