« first day (1091 days earlier)      last day (3859 days later) » 

11:05 AM
Dirty isn't it?
 
Make it a macro function at least, and don't include the semicolon.
#define TRACE() print(whatever)
 
I kinda like the unrefinedness TRACE.
No pretense.
 
It's error-prone.
 
I'm just kidding. I only use TRACE for quick experiments.
 
@StackedCrooked Indeed
 
11:11 AM
@ScottW TRACE
 
Xeo
@StackedCrooked passkey-pattern
 
I failed to make std::future<T&> work though.
@Xeo Ah, there's a word for it?
I was also thinking about it like a key.
 
@StackedCrooked Ugh why would you want that
 
Xeo
13
Q: Is this key-oriented access-protection pattern a known idiom?

Georg FritzscheMatthieu M. brought up a pattern for access-protection in this answer that i'd seen before, but never conciously considered a pattern: class SomeKey { friend class Foo; SomeKey() {} // possibly make it non-copyable too }; class Bar { public: void protectedMethod(SomeKey); }; ...

@CatPlusPlus Why wouldn't you?
 
ITT: Every fucking thing must be a pattern.
 
11:13 AM
@CatPlusPlus Now I have to do this: Protocol& protocol = *stack.addProtocol().get();
Which is not satisfying at all.
 
@Xeo It implies shared state between sender and the receiver.
 
Xeo
Good point
 
@StackedCrooked Just make it a value.
auto protocol = stack.addProtocol().get()
 
But it has a std::vector<Session> which would be copied then.
 
Copying is the point.
Don't share anything between threads, make copies.
(Well, or make everything immutable)
 
11:16 AM
But
 
It removes an entire class of bugs.
Writing correct multithreaded crap is hard even without shared state.
 
Dammit.
I agree, but i don't see how to implement it without breaking the app.
I see no way to avoid the shared state.
 
@DeadMG It has benefits: people can point to existing discussion on same the subject
It's not about "patterns" being magically more important. It's about recognizing when something has been done before and not reinventing/falling to the same traps
 
TCP is very stateful for example. I can encapsulate it somewhat in a finite state machine. But the inherent state can't be avoided.
 
@ScottW AND THAT'S A BIG "BUT"
@StackedCrooked Move the state into (and out of) the thread for the task
 
Xeo
11:22 AM
How did that go? "Share state by passing, not pass state by sharing."
 
@ScottW Heh
 
The stack is a object which represents a physical device. Copying the object won't copy the hardware.
anyway, this was not my intended discussion
 
Buttes
 
I wanted promise<T&>
I have to use promise<T*> now.
And I feel like using pointers makes me less cool.
 
I hate sharing containers etc. I will do almost anything to avoid it. The only things I am happy sharing are synchro primitives, producer-consumer queues and the like. If there is a large container, I manage it with one thread, (and maybe state-machine), and queue up requests to that thread.
 
Xeo
11:24 AM
@StackedCrooked Seems unnecessary, tbh, since std::future<T&> has a specialization even
 
Well, you can't synchronize without sharing synchronization primitives.
 
Xeo
and std::promise<T&> too
 
They're kinda designed for that.
 
@Xeo Could you point out the error in my code? (If you don't feel like it, don't worry.)
 
11:26 AM
Oh, wait there's no error in my code since I changed to future<T*>
I think Coliru should support multiple work pages or something.
 
@MartinJames Some containers are explicitly designed for concurrent mutation and generally being shared.
 
Xeo
@StackedCrooked Your problem is that lambdas deduce a by-value return type.
So you got, in fact, a std::promise<T>, not <T&> out of that
 
@DeadMG Yes, true, but just because they are thread-safe in themselves, this does not prevent all misuse :(
 
nothing prevents all misuse
 
@Xeo Oh, I just needed explicit return type in my lamda?
 
@DeadMG Well, I guess changing profession would work :) I would like to work in an Indian restaurant for a year - where the containers have only good food in them :)
 
Xeo
@StackedCrooked yes
All lambdas that are to return a reference need an explicit return type
 
C++14 can have auto&, right?
 
Xeo
ya
Or -> decltype(auto) for generic code
 
@Xeo awesome
@Xeo That's C++14 right?
 
Xeo
11:34 AM
Do you have the puppy on ignore? :P
 
Who'd ignore puppy. I mean, he never offends anyone does he?
 
Nope, but I thought his question was not necessarily identical.
 
Oh wait, you were talking to him and not to me.
 
well, even with pointers, is it OK to initialize one member in ctor, and another in member declaration?
struct Connection {
    Connection(asio::io_service& ioService) : m_ioService(ioService) {}

    asio::io_service* m_ioService;
    asio::ip::tcp::socket m_socket{*m_ioService};
};
 
11:37 AM
I ate a sandwich
time to see how well that goes down
 
Xeo
again?
You should stop eating sandwiches if they are no good
 
I'm hungry, they're tasty, I don't know of anything better to eat.
@Xeo If I applied that logic, I'd never eat anything.
 
Xeo
Only because you don't try other stuff
 
I've tried a lot of stuff in the last three years
 
I'm off for a cheddar buttie.
 
11:39 AM
Have you tried a fecal transplant?
 
no
the surgery is the first real medical treatment the doc has even considered
first time, I got "Fuck off and take antacids for four or five months"
then I got "Fuck off and lose weight"
although at least this time, I got "Fuck off and in two months, we'll consider taking actual action".
 
your doctor is a pottymouth
 
you'd die of vitamin deficiencies first
 
read that too
 
@Abyx I don't know the rule of the language here, but it looks like playing with fire to me.
 
11:42 AM
@DeadMG you go to a terrible doctor
 
Xeo
@DeadMG supplements
 
@StackedCrooked well yeah, I'm also not used to such code yet
 
Would passing my "key" object by value result in different object code then when it's passed by reference? (It's empty.)
 
Xeo
likely optimized out either way
as with tag-structs
 
@Abyx Yes, it's ok.
 
11:47 AM
GOG adds Witcher to any purchase for the next week
 
@TonyTheLion Or, maybe he's just a terrible summarizer
 
@R.MartinhoFernandes I hope so. In C++ there is always a danger to fall to the dark side :)
 
Ohai robot, did you see Andrzej's blog post? Now only Herb/Andrei need to mention this in passing and this subject will be well and truly beaten to death. Still, interesting to see everyone coming up with slightly different 'tastes' and preferences. (@R.MartinhoFernandes )
 
Yeah, I did see it.
 
@Abyx the order of declaration defines the order of initialization too
 
11:50 AM
But I was talking about it before it was cool :P
 
@R.MartinhoFernandes Talking about what?
 
@R.MartinhoFernandes I commented saying just about that :/
 
@TonyTheLion ¬_¬ knew what it was going to be, still clicked
 
Anyway, this cake is great, it's so delicious and moist.
 
@sehe I know. I'm concerned about obscurity/readability.
 
11:51 AM
@DeadMG Perfect forwarding ctors taking over copies.
 
@R.MartinhoFernandes Oh the comment is awaiting moderation
@Abyx In that case, don't! Still have accessors
1 hour ago, by sehe
@Abyx Or a sane solution ((free-standing) accessors?)
 
@sehe what is "accessors" again?
 
It's what you do when you don't want to write interdependent intializers
inlined functions that evaluate your reference on demand.
 
Is open-std.org working for you guys?
 
Xeo
11:53 AM
nope
2 hours ago, by Xeo
Hm, open-std.org seems to be down
 
@sehe I still don't get it. how can getters help in that code?
 
@R.MartinhoFernandes what's that site again? Does it host the standard docs?
 
@Abyx By not storing the reference. Instead, evaluate it when used.
 
@thecoshman heheh
 
11:54 AM
So, yeah, if you insist on having a (logical) reference member, nothing will ever help. However, you don't need to have the redundant member anyways
 
@sehe but I need a reference to io_service to construct socket
 
@Abyx Ah. I see your latest sample has slightly different specifics.
 
Xeo
@Abyx s/stream/service/
 
@Xeo yeah, thanks
 
Ah well, in that case, just leave it as is. People should know. And -Wextra -Weffc++ should tell people who don't know what order members are initialized.
 
11:56 AM
-Weffc++ is horrible.
 
cl.exe doesn't support it anyways
 
@R.MartinhoFernandes I know right :)
@Abyx But that's a deficiency
@BartekBanachewicz I love how you kindly disregard half the message consistently. Like earlier, people usually complain about boost being complex.
4 hours ago, by sehe
@BartekBanachewicz It's more than that: "Boost may be good library, but I personally dont like it for its size and complexity"
I personally like Boost better, I find it easier to trust and less restrictive to integrate into my projects.
However, Qt has definitive appeal, and I can see how some people couldn't fathom using boost if their life depended on it
@R.MartinhoFernandes Ah, the comment has been approved
 
NOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
s/z/s/
/szs/ is how I pronounce that.
 
bzzz?
 
boost is too good to be true, so I don't trust it
2
 
12:04 PM
@R.MartinhoFernandes Ask a Czech
@R.MartinhoFernandes Oh damn. I did it again. Sorry... At least I got the link right
@MarcClaesen You mean, it has human members. Oh well.
@StackedCrooked Except that, really it isn't too good to be true. It's just way above average. But considering the amount of time invested, it's not beyond belief.
 
good afternoon.
 
> Msg 262, Level 14, State 1, Line 1
CREATE DATABASE permission denied in database 'master'.
 
STL is the worst at reading abbreviated identifiers.
 
I don't like SQL server
@R.MartinhoFernandes putter
 
@TonyTheLion "stir"
 
12:16 PM
@R.MartinhoFernandes STL as in Stephen T.. L..?
 
Xeo
@R.MartinhoFernandes "stool"? :P
 
is that string?
 
@TonyTheLion There's a variable called str.
 
oh gawd
 
... fill me in guys, I wanna take part of this highly interesting conversation! (not joking, I really wanna take part)
 
12:17 PM
the most confusing thing about ptr is that in assembler you have BYTE PTR ... which doesn't necessarily mean pointer.
 
@refp you too, kind sir
 
@refp Stephan T. Lavavej
 
@DeadMG ah, Stephan* even
I've been watching his talks many nights when I've been too drunk to do anything else
 
do*
 
I want to do something fun
 
12:21 PM
I'm too hung over to do anything, but it's friday so I guess I can cure it with a fresh new alcohol session later this evening
 
user1804599
Ugh.
 
user1804599
ALTER TYPE y u no work inside transaction.
 
user1804599
FU PostgreSQL.
 
user1804599
@CatPlusPlus create cats.
 
@CatPlusPlus fun is undefined
 
12:29 PM
@not-rightfold because it's DDL, not DML
 
user1804599
@sehe But ALTER TABLE does work inside transaction!
 
@R.MartinhoFernandes I remember he said std::vector as "stud vector" - but I used to say it as "es ti di vector". Which version do you use?
 
@not-rightfold That's sick
 
user1804599
@sehe Why?
 
@EvgenyPanasyuk "standard vector"
 
user1804599
12:29 PM
It’s expected.
 
@EvgenyPanasyuk I say vector (I rarely need to indicate a non-standard vector)
 
Transactional DDL is a good thing
 
@TonyTheLion it's quite obvious that "fun" is an abbrevation of "function" and that @CatPlusPlus really just wanna do { something; } while (fun ());
 
But I suspect type system is too hard to transactionalise properly
 
@sehe It's not about vector. Suppose you need to say "std::" - how would you do that?
 
user1804599
12:30 PM
I can drop and create data types inside of transactions.
 
user1804599
Why can’t I mutate them. :c
 
@EvgenyPanasyuk "standard [library] namespace"
 
user1804599
I say es tii dii.
 
IOW, I don't try to pronounce acronyms. I do pronounce abbreviations, though (filebuf etc)
 
12:31 PM
> ALTER TYPE ... ADD VALUE (the form that adds a new value to an enum type) cannot be executed inside a transaction block.
 
user1804599
@CatPlusPlus Indeed. :<
 
@sehe like "standard namespace double ended queue"?
 
@refp hahahahah
 
@EvgenyPanasyuk No. Just deque (deck)
 
@not-rightfold Ask them why
 
12:34 PM
@EvgenyPanasyuk Should I have to explain that there is a 'double-ended queue' abstraction in the standard library (when!?!? why?!?!?) then, yes, I'd say it in full. With context and intent.
 
Xeo
@R.MartinhoFernandes, your thoughts on this?
 
@sehe ok
 
Xeo
I had the same reaction when I read the DR :(
 
What a bullshit resolution.
 
Xeo
12:38 PM
It's horrible.
 
Just... no, what the dumb fuck.
 
Xeo
Moar special-cases.
 
ah...
 
Isn't that what C++ is all about? :P
 
I want int f(int x) { return g(x); } to result in f == g.
 
12:38 PM
play a game -> teammates only speak German -> teammates accuse me of non-teamplay at the end of the game in English.
 
IOW, GET THE FUCK OFF MY LANGUAGE, PHP PEOPLE.
5
 
JBL
@DeadMG Immediatly thinking of DotA2 and Russian people.
 
frankly
every time I play games online I'm shocked by the poor quality of the other players.
these days I'm almost considering just not playing anymore.
 
@DeadMG Learn German!
 
Xeo
12:41 PM
@DeadMG As is everybody else.
 
amazing that it never used to bother me.
 
huh, new one on me. Word said there was too many spelling and grammar mistakes
9
 
"PLEASE MAKE IT STOP"
 
JBL
Playing online now means doing 1v1 or sticking with friends in team games.
 
12:44 PM
it was a code file that I was wanting print out though :P
 
I hope that after this they make it so that f == g given int f(int x) { return g(x); } and int g(int). — R. Martinho Fernandes 4 mins ago
@thecoshman You paste code on Word to print out o_Q?
 
@R.MartinhoFernandes, yesterday you said something about getting IDs with this. How d'you do that?
 
@Jefffrey A pointer to it is already a unique identity for an object.
obviously pointers could never, ever, function if an address could have more than one object on the other end.
 
Oh, I thought something else.
 
user1804599
@CatPlusPlus Ok. :3
 
12:48 PM
@Jefffrey Keeping the caveats other people mentioned about it (specifically, if the ID needs to leave your address space, this is not good), you can just void const* id() const { return this; }.
 
Ok, fanks.
 
@sehe I especially meant "because big"
 
@R.MartinhoFernandes working from remote desktop, so I can't print form there. Had Word already open, so just ctrl+n and paste... then took note of just how much there was :P
@R.MartinhoFernandes ps, I like the monocle
 

« first day (1091 days earlier)      last day (3859 days later) »