« first day (892 days earlier)      last day (4056 days later) » 

10:08 AM
@BartekBanachewicz It wasn't me! Who have you pissed off?
 
@MartinJames it was undownvoting from yesterday evening
 
http://coliru.stacked-crooked.com/view?id=94e78ba3323c8eedb1aebb3fba774be1-50d9cfc8a1d350e7409e81e87c2653ba
why is this not ambigious? /cc @Xeo
 
I'm guessing less template parameters means being more specialized.
 
Xeo
@LucDanton Not really
@bamboon partial ordering
 
10:14 AM
@Xeo do tell.
 
Xeo
partial ordering works by checking if one template's parameter types could be used as arguments for the other template
the (iter, iter) can be passed easily to (range, comp)
but the other way around doesn't work
So (iter, iter) is considered more specialized
 
> Partial ordering selects which of two function templates is more specialized than the other [...]
Fuck you.
 
Xeo
@LucDanton I meant the "less template parameters" part.
If that "fuck you" was directed at me.
 
The sole discriminator being the two templates is that one has one less template parameter. Partial ordering (so you say) favours one over the other. Hence, having one less template parameter makes one of the overload more specialized.
Fuck your 'not really'!
 
@LucDanton fewer
;)
 
Xeo
10:20 AM
But it's not the number of parameters that determines which is more specialized. This is just an effect of how the template parameter was used here.
 
@LightnessRacesinOrbit No.
 
@LucDanton yes
 
@Xeo Yes, it is.
 
You did it again!
 
10:23 AM
That was 'Yes, it is an effect.'
 
Xeo
Oh, sorry then
 
Silly English with no doch/ja.
 
Xeo
"Aye" :P
Or "affirmative". Military<C++>
 
ok, thanks for the help guys.
 
nice sample @Xeo
 
10:32 AM
@Xeo roger that.
but yeah, "aye" is the best
 
lol
gogogo
"Rule of three" functions *methods — Jueecy 3 mins ago
 
@LightnessRacesinOrbit aye.
Also I believe it's a dupe
 
@BartekBanachewicz Prove it bitch
 
3
Q: Are move constructors produced automatically?

DaniI have a big class holding a lot of STL containers. Will the compiler automatically make a move constructor that will move those containers to the target or I have to make my own?

 
10:38 AM
19
Q: Why no default move-assignment/move-constructor?

Viktor SehrI'm a simple programmer. My class members variables most often consists of POD-types and STL-containers. Because of this I seldom have to write assignment operators or copy constructors, as these are implemented by default. Add to this, if I use std::move on objects not movable, it utilizes the...

 
user1357851
Move constructor ...
 
how about that?
 
That's "when are move ctors produced?" This is "why is move stuff produced so hesitantly in comparison with copy stuff?"
@BartekBanachewicz that one maybe
@Telkitty what
 
There's another one, but I can't find it :/
 
Just say it's too big to fit in this margin
 
user1357851
10:40 AM
@LightnessRacesinOrbit pardon my ignorance, why move constructor, isn't that just copy + delete?
 
the tosser deleted is comments
@Telkitty Er, no.
 
hi @Robot.
 
@Telkitty 'coz you can't copy.
also it doesn't delete.
 
user1357851
@Abyx when is it used?
 
mawnin
 
10:42 AM
@Telkitty who?
 
user1357851
Can't copy and can't reassign pointer?
 
can't.
 
user1357851
@Abyx when are move constructor used?
 
@Telkitty You can copy any object, but it's not efficient like a move constructor
 
you can't copy quite a few objects, actually.
 
10:43 AM
all non-copyable objects
 
@Telkitty When you don't need to preserve the value of the argument.
 
user1357851
There is deep copy and then there is shallow copy
 
@Telkitty when you need to move stuff to a new object
 
There is no shallow copy. All objects copy what they own.
 
lads
 
user1357851
10:45 AM
you can't say copy(a->something){my_something = a->something;} and not deleting the something in a?
 
do you guys know whether there is already a boost::range::move in plan?
 
@Telkitty You could say my_something = std::move(a->something);
 
@bamboon You could just write an adapter that wraps a range with move iterators.
 
10:49 AM
@Telkitty There is much you must learn, young grasshopper.
 
boost::make_iterator_range(std::make_move_iterator(begin(r)), std::make_move_iterator(end(r)))
 
@CatPlusPlus It remains completely unclear to me "what" is a thing, though.
 
A board game scheme for Worms
 
lol
TIL about that function
 
user1357851
@Neil please enlighten me with an example of a move constructor that can not be accomplished by copy + deletion or passing the address of objects other than the memory was not created using new (stack variables) or cross domain programs (that uses remote procedure call to move objects on multiple servers).
 
10:55 AM
Moving is not copying, no
It'd be quite pointless if it were
 
ohai all
I got lost in math
 
hi king
 
user1357851
@CatPlusPlus thus deletion if it is a deep copy
 
Deletion of what?
 
10:56 AM
std::function's copy constructor copies the underlying function object, right?
 
@R.MartinhoFernandes right, that's probably even better. Though, I think that boost::copy(v | boost::adaptors::moved(), it) looks somehow confusing.
 
@Telkitty It's like asking why you have to use a reference to a string rather than simply copy the entire string
It's not that you can't, more like you shouldn't
 
Moving has no relation to copying whatsoever
 
Well it does
It has the relationship of being unrelated
 
@DeadMG Yes.
 
10:57 AM
moving copies pointers
 
user1357851
@Neil thus deep copy + delete
 
hm
 
copy does deep copy
from my limited understanding
 
at some level of abstraction, yes, you are copying something
at the object's level of abstraction, you are not copying that object
 
Move if as far from deep copy as you can get
 
10:57 AM
@Telkitty Except that's hideously expensive, and not all objects are even copyable.
 
move is essentially what silly people call "shallow copy" in some circumstances
 
you can't deep copy + delete a mutex.
 
@Telkitty Right.. if the string were the entire declaration of indepencence, the processor would copy it all
only to be deleted immediately afterwards
 
ok, I'm off to embedded classes
time to write some C
 
embedded classes
lol
 
10:58 AM
@Neil: SO seceded?!
 
@BartekBanachewicz Hi, I'm a pointer, please give me something to point at.
 
@TonyTheLion Point at @CatPlusPlus's tail
 
(it's the long appendage)
 
<--- Now points at @CatPlusPlus's tail
 
10:59 AM
@DeadMG You can't move it either :P
 
@R.MartinhoFernandes Naw, but you can move a pointer to it.
 
But that's a copy!
 
you can have std::unique_ptr<std::mutex>, you could never have std::deep_copy_and_delete_ptr<std::mutex>.
 
11:01 AM
It's almost April, it's still -2 degrees outside
Fuck you winter go die in fire
 
@LucDanton Or: indeed/+1/agreed/that's true/true enough/verily/hear hear/dat/it is/exactly/right/that's what I mean/definitely/yes.
 
yep, it's facking cold
@sehe lolwut
 
I did use 'yes'. And it didn't work.
 
@LucDanton No, you used "Yes, it is." :)
 
so I was attempting to understand differential equations
man, I'm not the math type, but it is interesting
how you can mathematically express the relation between two changing things
 
11:03 AM
It's not the lack of "doch/ja", in my view. It's that "Yes, it is." implies contradiction of an 'implied'/'suggested' "No, it isn't"?
 
well, with differentiation.
or indeed, a plain old function.
 
as in, how the speed of a car affects the change in time it takes to do a journey
 
@sehe Notice how it wasn't 'Yes it is', or 'Yes, it is'.
IOW doch/ja works in the written form.
 
@TonyTheLion The distance travelled by the car is the integral of it's speed.
 
11:04 AM
@LucDanton Ah. You are right in feeling this expresses the difference, but it's too subtle for internet engrish :)
 
@DeadMG its true
 
or to be entirely equivalent, the differentiation of the car's distance travelled is it's speed.
 
shut up lightness
 
I just used a shared_ptr, I feel dirty.
 
@CatPlusPlus The sun "is" a fire, but it will be a stretch to say that the sunlight is, too. In that sense, winters don't die in fires
 
@LightnessRacesinOrbit lol
@sehe fires do die in winter, no?
 
@sehe The sun is not a fire.
 
the sun is a big hydrogen bomb
 
11:06 AM
@DeadMG "quotes"
 
explosive stuffs
 
@DeadMG Why not?
 
@TonyTheLion Only in extreme cases. Or, if you will, they inevitably die regardless of the season
 
@LightnessRacesinOrbit Fires are combustion reactions with oxygen. The Sun does not burn oxygen as fuel.
 
11:06 AM
@DeadMG Congratulations you have passed my test
@R.MartinhoFernandes hah
 
conflatulations
 
user1357851
remember relativity, nothing can travel faster than speed of light? so when the sun is moving closer and at the same time the light is emitted from the sun, is the speed of the light in relation to earth still the differential of the distance between the light and the earth?
 
differentiation of speed and distance is a Newtonian dynamic.
it does not make sense in the context of relativity.
 
@LightnessRacesinOrbit Anyway, it would still not be fire, because it would use it as fusion fuel, not as an oxidant.
> New! Sign in and click the star to save this translation into your Phrasebook.
Fuck you Google.
 
Googlebook
 
11:10 AM
WTF would Translate need signing in.
 
Google was good cos it was simple and had no bullshit
.... fifteen years ago
now it's "SIGN IN! CLICK HERE! SUBSCRIBE TO THIS! ADD TO YOUR CIRCLES! GIVE US UR DATAZ!"
 
user1357851
No, google makes money from marketing. It means people who pay money can get their results put to the front page by google marketing people through SEO
 
"CUSTOMISE YOUR HOME PAGE!"
fuck off
@Telkitty that's been the case for years and years
 
North Korea appears to have crossed a dangerous threshold and developed a fully-functioning calculator: http://t.co/Ad6RKiQ2kJ
lol
 
@TonyTheLion I like how they use the same chassis as for their pianos :)
 
user1357851
11:14 AM
@LightnessRacesinOrbit and you are still saying google is good because it had no bullshit? :p
 
@Telkitty reading comprehension = medium; try again:
5 mins ago, by Lightness Races in Orbit
.... fifteen years ago
 
@Telkitty I never said "is"
 
user1357851
ITT it is official, my reading skill = F
 
user1357851
BTW what is fire? It is not a substance is it? Like it is not like water or silicon or even oxygen. Is it a temperature?
 
11:19 AM
@Telkitty Are you from the dark ages?
 
she is
didn't you know that?
 
user1357851
@LightnessRacesinOrbit enlighten me
 
@Telkitty Assuming you mean the flame, it is the visible output of a plasma
 
user1357851
I mean fire, can you not read too? :p
 
@Telkitty Fire is a chemical process. "A fire" is, well, a thing that is on fire (undergoing fire) plus the flame, I suppose. Possibly including the heat and smoke produced
 
user1357851
11:36 AM
I have never thought about fire is specifically 'rapid oxidation of a material in the exothermic chemical process of combustion'. Maybe it is the most common of all visible exothermic chemical reaction because air is made of 21% oxygen.
 
um, no.
fire is by far and away not a common reaction at all.
the most common reactions would have to be either atmospheric reactions, or biological life process reactions which are near universal like respiration or photosynthesis.
at least on Earth.
 
@DeadMG cellular respiration is a form of oxidation.
 
but it's not combustion.
 
user1357851
ITT we revise life sciences such as Chemistry and Physics
 
What have I started :)
 
11:40 AM
@DeadMG I'm not sure about that.
 
I'm not wholly sure what the difference is between respiration and combustion, but I'm pretty sure that respiration is far more controlled, and has a bunch of accompanying chemicals.
whereas combustion is totally uncontrolled and has no supporting chemicals, just oxidant and fuel.
 
user1357851
It is a balanced world - if there is oxidation, there is deoxidation. Both have equal and opposite effects
 
deoxidation fail.
 
It's called reduction.
 
user1357851
or photosynthesis ... sometimes
 
11:43 AM
no.
that's completely and utterly different.
 
> Although technically, cellular respiration is a combustion reaction, it clearly does not resemble one when it occurs in a living cell. This difference is because it occurs in many separate steps. While the overall reaction is a combustion reaction, no single reaction that comprises it is a combustion reaction.
@DeadMG ^
@Telkitty ... no.
 
FFFFFUUUUUUUUUUUUUUUUUUU
I hate it when supposedly simple tasks turn into something obnoxiously complex
mostly because I've overlooked something
 
11:59 AM
like photosynthesis
 
user1357851
It is almost as awkward as when you are telling your cousin how you are gaining weight for not eating much and jog an hour a day, she causally mentions "maybe you are photosynthesizing?", but you denies because "I AM NOT TURNING GREEN!"
 
12:14 PM
IIRC, not all organic, photosynthetic mechanisms require 'green'.
 
user1357851
Thank you, I hope you do indeed breath in carbon dioxide, drinking water and turn sunlight into your stored fat :p
 
wouldn't need to breath in carbon dioxide, I produce my own
 
If I could photosynthesize, today would be a good day. Still snow lying around, but no cloud means that the gravity-stabilized thermonuclear reactor is freely radiating light to ground level.
 
Oh, so Boost.Variant does use overload resolution rules to choose which member to initialize. I'm not sure how I missed that.
 
..and yes, I have too much stored fat to burn/respire off :(
Oh, just remembered. I can, in fact photosynthesize vitamin D.
2
 
12:27 PM
Also apply_visitor is 'curried', i.e. there's an overload for apply_visitor(v). How did I miss all this!
 
@LucDanton You mean, it will happily state ambiguity if multiple members could accept the initializer :)
 
probably you were too busy looking at stuff like how it has no move semantics
 
@LucDanton Huh. I'd never have known. Also, what is the effect?
 
@sehe What I don't mean is that it's a left-to-right scan, which is what I have.
 
@LucDanton Clear (<-- look ma, no doch)
 
12:29 PM
@sehe Result r can be used as r(var) or r(var, var), which visits!
@sehe Well before the parenthetical it was anything but.
(Free commas: ,,,)
 
...
@LucDanton Hmmm I'll look at that again sometime. I don't follow right now, but it sounds useful (often, my variants represent asts, and they have tree structure)
 
If you have a range of variants you can e.g. transform(range, apply_visitor(v)).
Ack, I keep using the algo form when I mean the adaptor form. Screw adaptors!
 
@LucDanton ah, now I get it
 
damn
not only did I use a shared_ptr, but I used a shared_ptr<T*>.
 
ITT puppy sucks.
 
12:40 PM
@DeadMG WUT
 
well, I need to cache the result of my functor, but I can't store it in the functor because it gets copied around a bit.
and the result type happens to be T*.
 
user1357851
I would like to nominate a new pattern to the design patterns - the stalker pattern (details to follow shortly)
 
Ah, pain from the lack of unique_function.
 
well
I don't see why std::function doesn't just share the object.
reference counting is no fun, but it's more fun than endless copies.
 
Depending on if/when you need actual type-erasure though you can write a caching functor that has move-only semantics iff the types involved have. But then you wouldn't be able to use those specializations with std::function of course.
 
Xeo
12:45 PM
@DeadMG mutable functors?
Should it do copy-on-call-to-non-const-operator()?
 
nah, just overload on constness.
 
Throws away basic thread guarantee, too. Well, it changes that.
 
huh.
MSVC11 can deduce the return type of multi-statement lambdas.
I thought that the Standard said that only single-return-statement lambdas had to have their type deduced?
or, even more shockingly, did Visual Studio actually implement a convenience function for it's users, above what the Standard calls for?
 
Xeo
Remember, there's a proposal / solved DR to allow that
 
proposal, or solved DR?
 
Xeo
12:49 PM
I think both
 
Do the return statements still all have to agree? I mean the proposal-y thingies.
 
Who the heck added the tag [c++11] to a question that mentions iostream.h.
 
@LucDanton Yep.
couldn't even get away with a derived-to-base conversion
 
@LucDanton They're very pedantic and disagree often
 
Xeo
12:51 PM
@DeadMG The DR says it should work with that, though
CommonType etc
IIRC
 
Ah, so they don't have to.
 
@R.MartinhoFernandes someone ported it :)
 

« first day (892 days earlier)      last day (4056 days later) »