« first day (1786 days earlier)      last day (3177 days later) » 

10:00 PM
@набиячлевэлиь If r is a variable that’s unlikely to do what you want.
 
yeah use std::remove_cv<std::remove_reference<decltype(r)>::type>::type for good measure
 
@milleniumbug Well, not that. ctype<T> widen()s to T
 
yeah but r could be a reference :P
 
@milleniumbug std::decay_t if you don't want to type.
 
@Morwenn et mah gherd C++14
its so noo
no cimpoler sappurt
C++03 only !!
 
10:05 PM
Good, my new sorting algorithm also works with C++03. That's probably the only one of my projects to do so.
 
what's really funny about that Butthurt report form is all the old irrelevant websites mentioned
like LiveJournal
 
@Morwenn need C++98 support nao !!
 
you unreasonable twat
maybe you want C++ ARM support too
inb4 flags
 
@набиячлевэлиь Most compilers don't even make the difference.
 
afair the only differences are: in C++03 std::vector must be contiguous and C++03 has value initialization
 
10:09 PM
That's the only differences I know about.
 
Neither of them require special C++98 treatment
 
5 years for that...
 
user1804599
In swift when importing lib A that has a function with a type from lib B, that function is not available unless you also import lib B.
 
user1804599
That's nice.
 
Dependent imports? I always wanted those to exist, but never knew how.
Like, you get overloads for math functions if you import <cmath> and <complex> but not it you only import one of them.
 
Ell
10:15 PM
Why would you want that?
Reduce compile times?
 
@Ell less name collisions
 
user1804599
Almost but not quite entirely unlike dependent typing: coliru.stacked-crooked.com/a/99383e7f8bfa77ba :D
 
and it's more obvious
 
The consistency in my head.
 
Ell
Oh wait
 
10:16 PM
you only have shit imported that you imported
 
Ell
Also it means optional dependencies are easier I guess
No need for #define USE_GLM or something
 
equally, it's nice sometimes to import a lib, and through that have another lib imported
 
@elyse There's nothing nice about Swift.
 
user1804599
lol Puppy's opinions
 
user1804599
also, I should implement STM in Go
 
10:17 PM
unlike you I've actually had to use it
 
user1804599
That doesn't make any difference.
 
yes, how could actual professional experience in a language be of any relevance when assessing it?
2
 
user1804599
Firstly, I gave a first impression about a feature externally described. Also, you do that all the time, so stop being a pot calling the kettle black.
 
user406009
@Puppy Well, better Swift than Objective C.
 
@Lalaland I'm actually starting to doubt that.
 
10:23 PM
@Lalaland what, why would you want to use Swift? Unless we're talking about Taylor Swift and not the Apple excrement.
 
user406009
@ElimGarak Swift has been carefully designed to work well with existing Objective C code.
 
it doesn't
 
user1804599
Today I have done something I had never done before.
 
user406009
Ok, designed with the intention of working well with existing Objective C code.
 
@elyse Actually used a language?
 
user1804599
10:26 PM
Written Go code with red nails.
 
@elyse Did you make use of advice under this message?
 
Written Go code with rednecks.
 
I need someone with gdb-fu. How can I tell it to just dump all the text it has to dump, without the useless pagination thing that might've mattered when terminals had no scrollback? Reasonable applications let you do that with space or something like that, gdb doesn't seem to see a need for that :/
 
lol expecting UI features from gdb
 
Ell
@Griwes try set pagination off
 
10:28 PM
@Griwes Run it through noninteractive shell :P
 
@Puppy lol no - every sensible application reacts to a space given in such a moment in the way I want
@набиячлевэлиь -.-
 
@Griwes That requires that gdb is sensible
 
@Ell <3
@Ell I love you <3
 
Ell
Love you too bby gurl
 
drunkell
 
10:30 PM
ell oh ell
 
I keep using global variables to manage global state. Is that an anti-pattern? For example I have a bunch of hardware devices, and I have a global variable called DeviceRoot that contains pointers to different devices. If I want to change a specific device I include the header in a cpp file and access my global object's pointer. Thoughts?
 
@Mikhail Sounds like something Puppy would love. Yum, globals.
 
@Mikhail No more thoughts, only meth now
 
O(n²) compile times are too long.
 
@Morwenn For n= what?
 
10:33 PM
Doesn't MS advocate the use of singletons for things like this? Recall a tech talk where the guy explained that if you have only 1 of something (computer mouse in this example)
@Morwenn Needs more pointers and forward declarations.
 
@Mikhail I have both a touchpad and a mouse at work.
 
inb4 MS doesnt know shit about software design
 
@набиячлевэлиь Actually, O(n*m) with n = 7 and m = 100.
 
firstly, your argument is an appeal to authority.
secondly, the example is fucking stupid.
 
user406009
@Mikhail Why can't you pass that DeviceRoot object into the functions that need it?
 
10:34 PM
thirdly, even the idea is fucking stupid.
don't do that.
 
@Morwenn thank you i solved my problam with your solution
 
go go puppy
show him who's boss
But seriously, make your state as local as possible
this applies to everything
 
Singleltons.
 
Hot singletons in your area.
 
@Lalaland That involves extra steps, for example all of my functions will become longer with addition of the object pointer. Further, I will need to dump tons of forward declarations in my headers. This is what I used to have...
 
10:36 PM
Singleton and ready to mingleton.
 
What happens when two threads access your globals AT THE SAME TIME (dun dun dun)
 
@Prismatic std::mutex?
 
laffo
 
user1804599
@Prismatic depends
 
@Prismatic Depends on what the accessing code does.
 
10:36 PM
yeah you could do that
 
What if I want to create a second DeviceRoot?
 
user1804599
SSCCE.
 
@Griwes nope
 
@Mikhail yese
 
is your global part of your public API
 
10:38 PM
@Griwes Trees don't have 2 roots
 
@Mikhail I want a second tree!
 
@Mikhail ?!??!?
 
@Mikhail I.e. a remote machine that's controlled from here (for whatever reason).
 
@jaggedSpire 3s don't have 2 roots.
 
@Prismatic No, but I heard something bad will happen if you try linking on linux.
 
10:39 PM
In vascular plants, the root is the organ of a plant that typically lies below the surface of the soil. However, roots can also be aerial or aerating (growing up above the ground or especially above water). Furthermore, a stem normally occurring below ground is not exceptional either (see rhizome). Therefore, the root is best defined as the non-leaf, non-nodes bearing parts of the plant's body. However, important internal structural differences between stems and roots exist. The first root that comes from a plant is called the radicle. The four major functions of roots are 1) absorption of water...
 
Even trees with taproot systems have more than one root
 
primary root
On the other hand:
 
Yes. It's a bad analogy. See: fibrous root systems
 
user1804599
omg a tooth
 
10:40 PM
@Mikhail what do you mean by that
 
Lounge<Teeth>
 
real talk lounge, who here has had their wisdom teeth removed
 
Lounge<Roots>
Root<Lounge>
 
By the way, what happened to the hierarchical collections proposal?
 
@Prismatic They had to break one of mine to get it out! :D
 
10:41 PM
Lounge<Rootfold's Teeth>
 
@jaggedSpire noice. Me too
 
@jaggedSpire D:
 
I was under tho, good times
 
@Nooble crunch crunch
 
Poor teeth.
 
user1804599
10:41 PM
Lounge<Lounge<Lounge<Lounge<Lounge<Lounge<Lounge<Lounge<Lounge<Lounge<Lounge<Lou‌​nge<Lounge<Lounge<Lounge<Lounge<C++>>>>>>>>>>>>>>>>
 
Yep same here. I don't remember a thing. The entire operation is a jump-cut in my memory.
 
Ell
Hierarchical collections?
Like tree<T>?
 
Thir<T>
 
user1804599
bukk<ake>
 
10:42 PM
Ah! Ah! Ah! You didn't say the magic word!
 
user406009
@Mikhail According to that comment, the solution is simple. Simple have your global be a pointer to your singleton.
 
@Nooble Abra Kedabra?
 
@Ell Yes, N3700.
 
2 days ago, by Marco A.
user image
 
user1804599
COCK
15
 
10:45 PM
let's see if steam's refund option works
it should
 
it had better
 
Nom nom nom.
 
@Nooble yes you can rearrange words. Good job. Have a cookie!
 
Why does the lounge have such a fascination with the starring of the word "cock"?
15
 
starfest
 
user406009
10:47 PM
@Mikhail Anways, I can understand why you you don't want to be passing that parameter around everywhere. Some programming languages (Scala) actually have considered it such a problem that they have implicit parameters.
 
user406009
@TonyTheLion It's not the Lounge. It's individuals within the Lounge.
 
@Lalaland Technically you are correct. Do I care? No.
 
@Lalaland Considering the number of stars, it's a good portion of the Lounge though
 
796e43a5a8cdb73b92b5f59eb50610cea3efa8ce229cd7f0557983091b2b4552
^ "cock" hashed with sha256*
 
wat
 
user406009
10:48 PM
@Mikhail Anyways, I don't consider singletons inside an application that bad. Singletons are mainly evil when they are part of a library.
 
user406009
And that's when you get the annoying linking issues anyways.
 
bite
 
user406009
And the fact that that one singleton might be shared if you are dynamic linking, etc.
 
HEAR THAT, NOOBLE?
 
Ell
What is the advantage of a singleton over a Vanilla global?
 
10:49 PM
I like vanilla shakes.
 
@Ell you can do dirty class things to it.
 
@Ell So that is the question asked on the reddit, in conclusion the singleton avoids weird linking problems?
 
I thought the refund would be automated, it actually creates a support ticket that has to be reviewed
 
user1804599
@TonyTheLion because COCK YUMMY
 
oh well I guess I'll wait
 
10:50 PM
@AlexM. Yes
 
Ell
What are the linking problems that arise?
 
I want to hide a type, then cast it back to its fully derived type but I dont want to use pointers to avoid heap allocations :[
 
@jaggedSpire yes :(
 
Ell
What do you want to do with it while its hidden?
 
user1804599
@Prismatic Then do heap allocations.
 
10:52 PM
@Prismatic but pointers don't require heap allocations?
 
@Prismatic these are orthogonal
 
user1804599
I think you can use std::unique_ptr with incomplete types.
 
Ell
Also what these folks are saying
 
@Prismatic If its POD you can do MSVC crap like stack_alloc
 
user406009
@Prismatic The more interesting question is where are you holding the type?
 
user406009
10:53 PM
Do you know the size of it?
 
well I am passing these types to a constructor and they are rvalues I think so the only way I can think of creating them is with new
 
Ell
You can do parent* p = &localchild
 
user1804599
Or use Scala or OCaml which have this as a language feature. :3
 
@elyse so long as it's a complete type where the compiler tries to generate destruction code
 
Derived a; Base* p = &a; auto q = dynamic_cast<Derived*>(p); doesn't use heap allocations
 
user1804599
10:53 PM
@jaggedSpire right
 
user1804599
If you want abstract types in C++, you're pretty much doomed.
 
user1804599
You need pimpl boilerplate.
 
Ell
@pris this, seems so bizarre
You want to contruct a new derived and pass it as a base?
 
user406009
@jaggedSpire Not quite right. You can use std::unique_ptr with a custom deleter.
 
Ell
10:55 PM
It just seems so strange
 
YOU seem so strange
 
Ell
Very fishy to me
I think this is XY
 
you're an xy
 
@Lalaland But wouldn't it need to theoretically know the complete type in a proper destructor call anyhow?
 
user406009
@jaggedSpire No.
 
10:56 PM
@Lalaland Huh
 
user406009
You can use std::function<void(void*)> to hold the destructor.
 
Ell
Ohh I see whyyou want to do it now
 
@jaggedSpire So forward declare a destructor
 
user1804599
@Lalaland why
 
user1804599
just do void(*)(void*).
 
user1804599
10:56 PM
You don't need anything but that.
 
Careful, don't call delete without the complete type. Its UB and most of the time it won't be resolved (won't destruct)
 
@elyse For a very narrow description of abstract types.
 
1 hour ago, by Lalaland
I just use std::functions everywhere. There is a performance cost, but I don't care enough to worry about it.
 
user1804599
@CaptainGiraffe Why?
 
Dedicated destructing function objects are better. You don't have to pass them at construction.
 
user406009
10:57 PM
@Prismatic Do you have bounds on the types you want to support?
 
@elyse For starters '=0'
 
user1804599
That doesn't create an abstract type.
 
user1804599
It makes a class abstract.
 
user406009
@Prismatic Or, more importantly. Do you have a max size for the types you want to support?
 
@Lalaland only requirement is that they must be copyable
 
user406009
10:58 PM
Then you are forced to heap allocate.
 
Were you thinking of a union
 
@elyse Please enlighten me
 
user1804599
An abstract type is a type without a (visible) definition.
 
user406009
@Prismatic Yes.
 
user406009
Like what std::variant does.
 
user1804599
10:59 PM
Such as A in trait T { type A } in Scala, or t in type t;; in OCaml.
 
user406009
If you have a bound on size, you can stack allocate.
 
Now we are arguing about semantics. Not actual constructs.
 
user406009
Theoretically, you could probably make a class that stack allocates for things below a certain size.
 

« first day (1786 days earlier)      last day (3177 days later) »