« first day (2153 days earlier)      last day (2792 days later) » 
00:00 - 20:0020:00 - 00:00

12:02 AM
@sehe I debated about replying to this. It's hard to write a good answer. Memory mapping works well on most Unix, but is generally quite slow on Windows. If you use normal stream functions, seeking can be much slower (than just reading) if the destination is in the same file system allocation unit.
 
@JerryCoffin I don't think anything should be about speed here. (I just posted an updated comment that actually used istreambuf_iterator<char> since that was the point of the switching_copy implementation)
Efficiency, yes. Absolute speed: not so much. My last version is at least as efficient as it gets (with either mapping or streaming).
I'd like things a lot more generic. But no time (/cc @caps)
 
@sehe I'm not sure exactly how you're using "efficiency" here, so I'm not sure if I agree or not.
 
Not wasting resources. (Isn't that pretty much the definition of efficiency?)
Any trade offs are going to hinge on actual usage patterns or even branch prediction scenarios. That's "out" IMO since we don't have any information to profile by.
 
@sehe Well, for example, if you're targeting Windows naive code may easily be three times faster. Do you consider that an efficiency problem or not?
 
Nope (also, how?!)
That's performance, not efficiency. Right. Am I doing something that's actively wasteful? The worst I can think of is copying byte-for-byte. I'm hoping the usual inlining/unrolling/vectorizing MIGHT apply. Although it's a stretch.
 
12:13 AM
@sehe Memory mapping is frequently quite slow on Windows.
 
You're not even paying attention. :(
My addition tonight doesn't advocate nor require memory mapping.
 
@sehe For most people, there are really only a couple of measures of performance--total time, and (possibly) total memory used (and the latter, almost exclusively if it's to the point that it causes them a problem). As such, I think most of them would consider your notion of efficiency utterly pointless and irrelevant.
@sehe So boost::iostreams::mapped_file_source is("/Archive2/62/52a5db711d1290/main.cpp"); isn't really doing/using memory mapping? If so, I still dislike the code, but for different reasons (being misleading, as a start). :-)
 
Please. It's not that hard to find. I didn't think I needed to copy every comment here :(
@JerryCoffin I don't think I care.
I was responding to @caps mesmerizing that the standard library algos don't do much here. I tend to disagree, and demonstrate so by implementing it in relatively straight-forward modern C++ without wasting resources.
@JerryCoffin To dispell anymore confusion:
Silly me forgetting to actually use istreambuf_iterator<char> now that it can coliru.stacked-crooked.com/a/40084500c1f58f19sehe 23 mins ago
 
@sehe o.O I'm bookmarking this coliru for further study
 
12:29 AM
devmatlabcent6
Oops.
Now I can't log in.
 
@sehe While I agree with the general idea, I would say that in most cases, the user's time is the single most precious resource involved. Don't get me wrong--I'm not trying to say that this is wasteful, only that performance can matter--and when it does, it frequently matters quite a lot.
 
I am starting to realize why a local vm is a better Idea.
 
@sehe Mostly they don't provide a clean way to bail if you have reached the last line you care about. It's not the algorithms's fault though--it's really a range/iterator thing.
 
@GGB667 You can delete messages
 
But you know what? You could do it with throw and a try/catch. It would just be ugly.
 
12:33 AM
Yeah. Dismissed that (partly because it would not work when compiling with exceptions disabled)
 
I wouldn't do it that way, which is why I have the raw while loop.
I suppose a "heavier" iterator would let me use for_each.
i.e. if the iterator checked against a lambda or pointer to some other range to check for an early exit, then return == end prematurely.
It is a fun problem for bikeshedding. I may play around with some other solutions, but I am happy with what I provided insofar as it solves the problem and handles the corner cases I could think of. I think it is about as clean and elegant as I can get for handling an uncached input stream without writing some external generic pieces. Then again, I haven't given it a thorough second look since posting it to identify other elegance refactors.
 
@caps Yup. The simplest fix in my scenario replaced for_each with while: this - A more obtuse take on it updates begin like so
@caps ^
 
@sehe Right. Now you are cleaner than my solution without anything that is obviously more expensive. You are also no longer using any of the standard library algorithms. :p
 
I think that would count as more elegant - since it makes no assumptions about where to collect the result. (You could easily make a line-break output iterator if you really need the separate lines in a vector<string>). Also, like you said, a problem with vector<string> is you can't reserve the allocation for each string. So, it's more interesting to just just stream to a single buffer and perhaps make a vector<string_ref> on top of that
@caps I'm aware of this. I think it's sad that the standard library keeps shying away from the obvious copy_while or copy_until etc.
 
@sehe Yeah, I alluded to that custom output iterator earlier. I like the idea of the vector<string_view>. You can reserve pretty aggressively in that scenario: buffer.reserve(line_count * expected_line_size) and refs.reserve(line_count).
 
12:47 AM
@sehe suffixes!!!
 
Of course, I pondered that question myself before and it's due the lack of composability. Really hoping the Range Revolution removes the bottleneck heree
@caps I'd not reserve at all there unless the linesize is predictable. std::vector growth is pretty ok
 
@sehe shrug with the vector you know how many lines you are expecting to get out. It doesn't seem like it hurts you to reserve unless you expect the input will be insufficient. As far as the string buffer, though, I could go either way. Again, it depends on the predictability of your input.
 
Agreeing
 
so whats cool in the C++ world?
Also we need to extend #pragma comment(lib, "toxic_sdk.lib") to include an option to load only on dll invocation. There is a linker/compiler flag for this, but compiler flags are for barbarians.
 
You pretty much nailed the most uncool things :)
 
1:00 AM
when will C++ have an elseif to match #elif in the preprocessor!?
 
@sehe lol
 
@Mikhail Probably never. elseif doesn't gain enough over else if that I can imagine the committee even giving serious consideration if somebody was crazy enough to bother writing a proposal.
 
@JerryCoffin Is it anything other than 1 less character to type?
 
@JerryCoffin Might be a good one to write on April 1st :-), or possiblt to deprecate #elif (and break a bunch of code)
 
@caps I'd certainly hope it was otherwise identical--if there was any other difference, that would be a good reason to kill the notion all by itself.
 
1:10 AM
@caps step 1 to more generic. step 2 maybe?
 
@Mikhail Could be removed without harm, but utterly pointless to do so at this point.
@Mikhail I don't see a "down vote" button...
 
@JerryCoffin Its the same as the upvote button
 
@Mikhail So you click "vote", then pick whether you're voting up or down? Who designed such a crappy UI?
 
@JerryCoffin Yeah, and make sure to dedicate 3 votes to it
 
I had a thought yesterday that if constexpr means we have an associated expression to std::conditional_t<Cond, Then, Else>, namely [] { if constexpr(Cond) { return std::declval<Then>(); } else { return std::declval<Else>(); } }() or close to
 
1:14 AM
@Mikhail Sorry, but I'm pretty sure I'm not dedicated enough to bother.
 
kinda lame that if constexpr only works in function bodies
 
that’s the thing though, lambda expressions allows to cheat and if constexpr bypasses the common return type requirement
 
Also, would be nice if some Qt users raised the priority of this item: bugreports.qt.io/browse/QTBUG-44056
 
It'd be cool if we could do e.g.
template<unsigned I>
struct something {
    if constexpr (I == 0) {
        using type = int;
    }
    else if constexpr (I == 1) {
        using type = double;
    }
    static_assert(I < 2, "must be less than 2");
};
w/o std::conditional_t obv
 
that throws nice scoping rules to the wind for no obvious benefit
 
1:18 AM
yeah it's obvious why it got rejected
 
@sehe That's better.
 
@caps In case you were wondering why State is a template argument, you could make this into a multi-state machine, with readable states: coliru.stacked-crooked.com/a/1009ac7b0caaee87
 
We obviously need to be able to create constexpr arrays of types, so that would be something like:
constexpr_array types{int, double};
static_assert(i<2);
using type = types[I];
 
ah yes :p
a glorious std::tuple
 
Hana actually does the types[2_c] thing btw
 
1:29 AM
@Rapptz Shhhh...say not the word that almost rhymes with double, or thou shalt surely waken the beast...ahhhh....too late. It comes....
 
double trouble incoming
 
I suspect my program to be going over bounds in select places but a blind shot at adding canaries didn’t help :(
 
Replace pointers with std::array/std::vector, use the bounds checking version of these, also remove unsigned stuff...
 
would take a fair chunk of work, whereas I already know how to fix the code
it’s just I wanted to catch it in the act
 
pay the technical debt :-)
 
1:43 AM
Sounds like it's time for some unit tests and refactoring
 
these are the tests
 
O.o Then your tests are horribly broken and your code cannot be saved. Sorry for your loss
 
@Aaron3468 you can’t test for UB
you can only hope for the best (hence the canaries)
 
Did you say UB :>
 
Yeah, I hear Bootstrap doesn't have these issues.
 
1:45 AM
I just had the best idea ever
 
That's odd, I'm pretty sure I already had that one.
 
@Darkrifts Wire-transferring me all ur monies? :3
 
@Aaron3468 also, the bug is in the implementation, not the tests
 
Ah, then you're not screwed :)
 
Sorry for you boss
 
1:49 AM
In that case it's just a matter of adding more test coverage until you find out what's triggering UB and out of bounds exceptions
 
the UB is going out of bounds
 
@LucDanton The best way to avoid UB is to not use C++/C
 
std::array, std::vector...
 
@Mikhail yeah I’ll go with std::array this is too important not to do it
oh hey non-constexpr std::array
 
like programs written in other languages don't have UB
 
1:57 AM
@Telkitty some
 
Also what's the best version of Ubuntu to be on?
 
@Telkitty Gentoo
 
~_~
Gentoo isn't a version of Ubuntu >_<
 
Try Gentoo 16.04 LTS
 
no range constructor for std::array
 
2:05 AM
Indeed, I've always felt this was an omission. Perhaps std::fill?
 
std::copy was enough in this instance, no need to do it nicely
 
bonus points for std::memcpy :-)
 
that won’t do, the elements are std::strings
also whenever I had a = { {}, foo, bar, baz }; I have to double-brace it to = {{ {}, foo, bar, baz }};
there’s only an ambiguity in case of a leading {}
 
help desk couldn't figure out why, I need to try to figure out what's the issue with failed upgrade myself :/
 
aw, libstdc++’s std::array<El, N>::iterator is a pointer type :(
 
2:24 AM
why is that bad
 
@Telkitty C# isn't safe anymore
 
@Rapptz I want a safe iterator
 
I found out how to UB on it
:>
 
Let us know when find out how not to UB on things
4
 
worst CS department ever
 
2:38 AM
oh ffs now I move-only elements in a vector’s initializer list and of course that doesn’t work
but hey if I leave out that TU for an instant then now I get to see the bug in action
does libc++ have their own safe iterators and how do I turn that on?
> Note: Debug mode is currently not functional. Defining _LIBCPP_DEBUG will result in fairly nasty compile errors.
> Last Updated: 3-June-2014
 
2:57 AM
> value = <error reading variable>
possible the pretty printers are broken
oh, or just sucky
 
Fuck its like 10:00pm, going to need something stronger then wchar_t.
 
is CString stronger or weaker?
 
a better joke would have been wchar_coffee
 
3:56 AM
@Mikhail Voting to close as "too broad".
 
 
What's up guys
 
0
Q: What is a "multiple definition" or "duplicate symbol" error and how do I fix it?

BrianWhy do such errors occur? How can this be prevented? This is intended to be a canonical question for redirecting duplicates.

 
 
2 hours later…
6:03 AM
@LucDanton Meh
Speaking of meh, why struct not_standard_layout : standard_layout {} ? I don't understand the rationale
 
6:36 AM
@AndreasPapadopoulos that’s not quite right
 
Xeo
@AndreasPapadopoulos When the child also has members, then it's not.
It's a xor - either one can have members, but not both
 
the reason being that inheritance just doesn’t mix with the C-style of doing things
@AndreasPapadopoulos why even care, 'is standard layout' is not a very interesting or useful property anyway
 
yep, I have more uses for is_trivially_*
 
I should clarify that I’m really baiting the story of all the 'orrible union stuff that is going on
 
7:01 AM
Hello Everyone
Did ENOTSUP (Operation not supported) error comes due to operation not actually supported by operating system, or there is something wrong with my application.
Not sure where to look with this
 
@mSatyam The function/system call is not supported in your OS or library.
What are you trying to do?
 
just waiting on select, having one fd in write fd set and NULL in other fd sets
as soon as code hits that select statement I get this error
 
@mSatyam Hmm, is the handle writeable at all?
 
yes just one sec before the application wrote couple of bytes to it and the data was also received at the other end of the socket also by the server application
Is this possible something went wrong earlier and now select is complaining about it
 
Xeo
7:25 AM
> lost data when save data to mongodb with c++
 
Man... I just had a though!
I want a Dead Space game where the faces of the monsters are provided all by real people!
Then each of the monsters would be unique!
 
nwp
@wilx imagine the killer game narrative
"children are trained to kill ordinary people by computer games"
 
@nwp Hehe.
Let them talk.
 
nwp
you can probably make a mod
 
Also, in Dead Space the monsters are really far from people.
 
nwp
7:37 AM
or use one of those character creation engines and feed it with random values
 
7:49 AM
@LucDanton As usual I should clarify. Both have members, so as Xeo said the child is not standard layout. I don't really understand the rationale because I don't see a difference with composition. I need this property because I offsetof into the child.
And unless I'm mistaken offsetof on non-standard-layout types is UB.
 
nwp
it is
IMO they should just drop the standard layout requirement, the compiler must know exactly which offset members have
 
not when dealing with virtual bases
 
they just don’t want to paint themselves into a corner when in comes to freedom of implementation with regards to that matter
whether that’s misplaced or not I truly have no idea
 
nwp
@milleniumbug why not? If you can do Foo f; f.a; then you can also do offsetof(Foo, a).
 
8:06 AM
@nwp But if you have virtual base Foo in some Bar and you try to apply the offset returned by offsetof(Foo, a) to pointer to Bar*, you will get in trouble, IMHO.
I guess that is why they do not support it.
 
Ven
8:23 AM
hi
@LucDanton if only we had expression if, huh :).
why did Feeds post something here?
 
Ven
ooh. haha
 
I wonder how quickly would a room subbed to , , and drown
 
Ven
8:59 AM
faster than your mom?
 
nwp
maybe regex works and you can sub to [tag:c*]
well, at least the murkdown doesn't like it
 
9:31 AM
Just what the world needed
 
@LucDanton Brillant.
@AndreasPapadopoulos Look at the date
Not sure this was a wise move.
 
10:02 AM
@sehe :D Nice one.
@LucDanton Heh.
 
nwp
10:19 AM
I have the situation again where I have a class FooDescription and a class FooInstance, essentially reimplementing classes.
Is there a way around that or is that just what you have to do?
Context is a data structure description read at runtime that is to be used to de- and encode data.
 
10:50 AM
I got more downloads on my funny cat apps than my trip plan apps
this makes me sad
 
user1804599
Learning C++ is like starring in Happy Tree Friends
7
 
@Telkitty Haha. Well, you know yourself very well how the Internet works. :D
 
Ven
11:24 AM
I stare into it.
 
11:51 AM
@sehe hi :)
 
@sehe Oh yeah 2003 lol
 
 
1 hour later…
1:13 PM
@AndyProwl oh look an imposter
 
lol
 
@AndyProwl Well, hello. Long time, no sea (which must be bad for a starfish).
 
1:44 PM
> g++ 4.8.4
tfw school uses old tech
> clang 3.4
what year is this
I'm gonna build a wget script into my builds that installs g++ and clang++ proper.
 
Ven
go ahead
wtf, @ThePhD, new user?
 
?
 
nwp
@ThePhD around 2014 apparently, not exactly ancient
 
> 2014 tech in current year
 
Okay. That was scary. Large SWAT operation opposite my house. 2 explosions (potentially distractions but still)
 
1:48 PM
I'm also upset.
A lot of the classes in my school are forsaking C++.
INCLUDING this Computer Vision course. THey're dropping it for Matlab.
 
nwp
@sehe damn, I knew I should have double-checked the number :P
 
I was super excited for this course because I wanted some C++ programming to FINALLY be apart of my core curriculum. NOPE, Professor threw out 15 years of C++ for Matlab.
 
@nwp ouch
I did send the kid upstairs until I knew the situation was safe
If you look outside and the place is crawling with police in bullet free vests that's not particularly encouraging
 
Guess that means no OpenCV for me.
 
nwp
@sehe I had that too like a year ago. Trouble was we couldn't get in to get the luggage to go to the airport.
 
1:51 PM
If it was GCC 4.9 and Clang 3.5 I'd be a lot happier, since that's the subset of C++ I use for sol2 and is compatible with VC++.
 
nwp
stupid guy with a gun apparently, and resident or not, when they think people will shoot they don't let you in
 
Yeah. In hindsight we passed some roadblocks half an hour ago coming home by bike. Something was up but I thought it was an accident at the crossroads
So I should have "known" to check the situation. Somehow it only dawned on me when I heard explosions
 
nwp
did someone actually blow stuff up? That is a bit more scary than waiting until the guy gets tired
 
or they were flashbangs
 
I'm not sure who threw stuff, but there was smoke coming from nearby an unmarked van that later seemed to belong to the police forces
@ratchetfreak Is that the stuff that serves to distract/disorient/scare the suspects? Could very well be that IMO
 
1:56 PM
@sehe blinding flash and a LOUD bang, little actual oomph
 
Oh, man. This 4.8.4 was compiled in 2013, not 2014?
Or is this some kind of "we forgot to update the copyright notice in version" thing?
Buh.
 
2:23 PM
I've never seen the error "Git is a total nightmare". Does it say anything else? Is it time to ask your own question, @Owl? — sehe 13 secs ago
Dis gun be gud
 
good dyslexia
 
Ven
dylsexai*
 
best kind of sexai
 
nwp
reminds me of the dyslexic satanist that sold his soul to santa
15
 
Ven
:/
 
2:33 PM
@nwp But what about his friend the dyslexic agnostic insomniac, who lay awake at night wondering if there was a dog?
 
nwp
@JerryCoffin he got bitten by it, which strangely didn't answer his question
 
@ratchetfreak The percussive shock and the magnesium from the flash can cause quite a bit of damage and burns respectively. It's best to call them a less lethal device... not non-lethal
@JerryCoffin He stopped wondering when they heard the karb
 
@Mgetz Mmmm...crab. Yummy!
 
yep, dyslexia is contagious on the internet ...
 
2:49 PM
@Mgetz Extremely rarely lethal, but not necessarily harmless.
 
@Mgetz I didn't say anything about lethality expect that they have less oomph than an actual grenade
 
@ratchetfreak Particularly, they don't (at least intentionally) spray shrapnel around like a grenade does.
 
There's also the one that blinds anyone too close to it, at least we have such a device in the Russian spec-ops. Said to be able to make you completely blind due to a retina burn
This one is different form the typical flashbang I think
 
3:06 PM
lol, something on hacker news still recommending on using RTLGenRandom
which... on any modern OS just forwards to BCrypt
 
lol using functions beginning with Rtl
 
We use RtlComputeCrc32 here.
 
unless you have to support XP... just use the CNG crypto api... it's the one used by the rest of the system
 
@iksemyonov Sounds different, anyway. Although it's not always successful, the design intent of stun grenades is to temporarily disable without causing permanent damage.
 
@EtiennedeMartel This is retarded and you know it. :)
Women gravitate towards teaching of kids at lower education levels, social work and being nurses that are paid lower than other jobs.
 
3:16 PM
@iksemyonov any of the magnesium ones can, if you added an oxidizer to the mix then it would be even brighter... and the UV could cause that
 
@Mgetz checked it out, they say there are models with 30 and 60 mln candel, but sadly I'm not familiar with the scale
 
1 candela is 1 candel's worth of light
mln would be million...
 
@iksemyonov for reference a flashlight is usually measured in hundreds or occasionally thousands of candela... so that's about as bright as a small sun
 
yeah, that can probably burn, even taking into account the personal differences
sure, it's just a shortcut for million
 
which incidentally could cause severe burns, just because that's a crap ton of energy
 
3:44 PM
@EtiennedeMartel why employers don't hire only females? should be cheaper, right?
 
maybe they want dikks?
 
no really. employers hire immigrants 'cuz they're cheap, outsource things to India or China, but still hire expensive males instead of females
 
@EtiennedeMartel Condensed into one sentence: "The vast majority of the wage gap is due to decisions women have made (and continue to make) voluntarily." And, although much more accurate than most, this still seems to focus much more heavily on men earning (on average) 11% more on entry to the work force than on men (again, on average) having more experience and working more hours than women when they enter the work force.
7
 
@Abyx Or because Americans are lazy
 
@Mikhail it's not only US
 
3:52 PM
Likewise, later in the article, they mention that: "She found that men see their salaries decrease more than women when they switch to a part-time schedule for a year." This is described almost as if it's planned by employers to get women to leave the work force. To me, this sounds like employers bending over backwards and favoring women in the work force, by continuing to pay them most of what they did otherwise, even when they reduce their value to the employer.
 
@JerryCoffin yeah... this is why the "what did you make previously" question should be banned though. A woman shouldn't be penalized for not getting the same raises that their male counterparts did when they get a new job.
 
@JerryCoffin To me, I think it's more of the "capitalism fucks everyone equally" thing.
 
@iksemyonov flashbang? that would be stupid to make a person blind, 'cuz you might need to use in a room with hostages
 
@Abyx Because women can get pregnant and then you have to pay her maternal leave.
 
@Abyx we have a whole range, some with mere thousands of candel, some like the ones above, 30-60 * 10^6
 
3:57 PM
@EtiennedeMartel sounds reasonable then. Such things should be in a contract.
 
though i see your point. maybe they're for different situations anyway
oh, i think i wanted to say mere millions, not thousands
 
@EtiennedeMartel so basically it's not because of misogyny, pure economical reasons. What's wrong with it then?
 
4:11 PM
@JerryCoffin here, the law is very clear. You have a right to get pro-rato pay if you decrease hours. (That is, IFF the job allows part time at all. Often, that's limited to a minimum of 32 hours in practice.)
@EtiennedeMartel In NL that argument is being picked up to lobby for equal paternity leave. A Good Thing(TM) IMO. Of course, there's pregnancy leave, which is for the pregnant party, but maternity/paternity leave should be equal/shared
 
@sehe Indeed. Taking care of children shouldn't be an exclusively female thing.
 
@sehe IMO (post-)pregnancy leave should be covered by medical insurance, just like other medical conditions.
 
In fact they're molding the existing (rarely used) option for unpaid leave (with gvt. funded residual pay) into a model where it's paid leave for either parent. That way, it's actually going to be useful, removing the incentive to hire men over women AND doesn't cost the a bit extra (since it just reshuffles the funds already reserved for the old regulation)
 
except that pregnancy is voluntary
 
@Abyx Pfft. Nobody is talking about medical conditions. Kids are not a medical condition.
 
4:15 PM
You don't want to penalize people for having children. That's how you end up with birth rate drops.
 
@sehe kids are not, but huge belly which affects your ability to work is
@EtiennedeMartel but someone have to pay for it
 
@EtiennedeMartel It isn't. In my experience, women tend to (often drastically) overstate the percentage of childcare that they provide.
 
@EtiennedeMartel except that men have no milk.
 
@Abyx While breast milk tends to be healthier for children, many babies are raised without it on a regular basis.
 
@JerryCoffin but artificial milk (or whatever it is) costs money.
anyways, a decent socialistic country could provide all of that
 
4:23 PM
@Abyx Of course.
@sehe I'd agree that pregnancy isn't a disease, but it's clearly a condition, and equally clearly has medical ramifications.
 
4:48 PM
Ah, right. Speaking of what governments should do - how many females are there?
 
@Abyx About 51% of most stable populations.
 
@JerryCoffin huh? I mean women in government. Who are supposed to do something about inequality
 
@Abyx Ah. I don't think it was at all apparent that you were asking about women in government. In any case, I suppose that depends (heavily) upon what government you're talking about. As I recall Canada's current cabinet is (rather famously) half female. I believe there are a few where women predominate. There are certainly quite a few where men predominate (I'd guess more than where women do, but don't have statistics to prove it).
 
Ell
@EtiennedeMartel Is dropping birth rates a bad thing always?
we have to keep population under control somehow, and not having a child is better than the alternative, generally
 
@Ell it's bad because muslims invade and replace your culture.
 
5:03 PM
@Ell No, not always. Most societies would prefer a nearly stable population though.
In particular, most societies basically depend on those who are currently productive to support those who are no longer productive. A shrinking population typically means fewer productive people compared to retired people, placing a larger burden on fewer people.
 
Ell
I agree that a stable population is good
but we certainly don't have that right now
I think a drop in birth rates would be good for the planet
 
5:28 PM
@Ell This is true. And, unfortunately, growth and the ability to support growth tend to be (something like) inversely related.
 
 
1 hour later…
6:33 PM
Your last sentence is an understatement. :) — Mysticial 56 secs ago
 
Ven
I need to learn about those.
Ouch.
 
7:05 PM
how is this UB?
 
note "unspecified behavior"
not "undefined behaviour"
 
ok google
hmm
ok
and according to what that should return false?
wait
i got it
 
also this is pretty much always false
 
yeah yeah
cause std::string::c_str() returns a const char* right?
so it would be comparing pointer addresses...
 
string literal type is a const char[N] (or something like it)
it'll decay to a pointer readily enough though
 
7:17 PM
but not the same pointer
 
So, I think this is UB by design - it gives implementations flexibility in how they pool their strings.
 
@JerryCoffin Again I find myself having to point out that you "catch" me on a distinction that I clearly made. I must be doing something wrong.
3 hours ago, by sehe
@EtiennedeMartel In NL that argument is being picked up to lobby for equal paternity leave. A Good Thing(TM) IMO. Of course, there's pregnancy leave, which is for the pregnant party, but maternity/paternity leave should be equal/shared
@ChemiCalChems That's an awesome diagnostic btw
 
@sehe yeah, the compiler is pretty neat
my local compiler didn't do that though
so i wasted two days making a basic pingIP function just because i was using c_str in a fucked up way
i'll have to add pedantic and wall
 
check out PVS and Reshaper
 
7:26 PM
@Ven Yeah, it's a pretty ugly topic. Took be a while for me to think that I got it right. And it took me a much longer while to actually get it right. And it will probably take me even longer to actually get it right for real.
 
@ChemiCalChems No no no. Time spent learning isn't wasted
@Mikhail I want Reshaper. For by back yard
 
code using VTK 7 won't build with GCC6 and pedantic, had to turn it off
bugs out on the macros with a stray semilcolon
Eigen shows walls of text with wall (i guess it is wall) :)
in short, i've been nothing but amazed having turned on the additional warning levels
told so much about the code
 
These could also be false positives...
 
7:49 PM
@ChemiCalChems Right. In this case, it's all but guaranteed to be false (though for a string_view it would be a lot more likely to be true).
 
 
@sehe ...or perhaps I am. I'm too lazy to spend enough time in the transcript to figure out for sure, but I'll try to do better...
 
:)
 
@sehe Even if you disagree with his conclusion, it's certainly nice that he provided such a helpful, detailed discussion of his reasoning.
 
Precisely. See my comment at the site :)
 
7:56 PM
Can anyone tell what happens internally when we dynamic cast , actually what is the need to cast dynamically ?
I understand what happens after casting and also understand that a derived class object can't be dynamic casted to a straight base object, because its not full.
But why is dynamic casting needed in the first place, any examples ?
 
wrong room
 
Oh Sorry .
 
00:00 - 20:0020:00 - 00:00

« first day (2153 days earlier)      last day (2792 days later) »