« first day (985 days earlier)      last day (3978 days later) » 

9:14 AM
0
A: Why using cannot be used to define a virtual function?

Ivaylo Strandjevusing in C++ has a different meaning and designates that you would like to be able to access a function/object in another namespace without typing the namespace name explicitly. It has nothing to do with classes.

This guy has a silver c++ badge >.<
 
JBL
@LightnessRacesinOrbit What ?
 
posted on June 27, 2013 by Eric Battalio

Since the newer Visual C++ content is not yet live on MSDN, I copied the key bits from the "What's New for Visual C++ Developers" and replicated it below. Note that this post may be removed after the MSDN content has been available for a few weeks. Thanks for your patience! Improved ISO C/C++ Standards Support Compiler Supports the following ISO C++11 language features: Default template a

 
JBL
9:30 AM
@LightnessRacesinOrbit Nothing particular, was just sort-of facepalming.
 
> Default template arguments for function templates.
Has anyone tested decent SFINAE on it?
 
@Feeds meh, I expected some more features than in CTP
> Resizable C++ Project Properties Window.
finally.
 
9:46 AM
@JBL aha!
@Abyx welcome to the 90s
> rvalue/lvalue Reference Casts. With rvalue references, C++11 can clearly distinguish between lvalues and rvalues. Previously. the Visual C++ compiler did not provide this in specific casting scenarios. A new compiler option, /Zc:rvalueCast, has been added to make the compiler conformant with the C++ Language Working Paper(see section 5.4, [expr.cast]/1). The default behavior when this option is not specified is the same as in Visual Studio 2012.
rut roh
> Brace completion
yuck
 
@LightnessRacesinOrbit they're trying to compete with VAX and resharper
 
@Abyx Is their completion fully dumb, fully smart, or half-smart?
 
it's pointless
 
ReSharper is going to take a huge slice of VS's business if they do it right.
I know I will port any and everything to ReSharper's IDE if they have a decent build system.
 
@Abyx =)
Resharper's website is great. Version number, clear indication of how long the trial period lasts, and a file size. A proper description of the product, and a screenshot. All right there on the first page. Microsoft should attempt to compete with that...
instead of "Download the latest MSN Messenger" -> INSTALL.EXE
 
9:56 AM
@LightnessRacesinOrbit And you get a bootstrapper that downloads the thing.
 
@R.MartinhoFernandes I hate that
 
Lol.
That's the worst, really.
If I'm downloading it, why don't you just give me the download.
 
@R.MartinhoFernandes My internet went out for around an hour yesterday, and I'm stuck writing VB.NET for a bit, and I kept trying to F1 on CBool to discover its exception semantics. Of course everything's "online help". Microsoft cannot comprehend that not everybody is/wants to be online all the fucking time and do everything over the internet.
"everyone's got the internet so who cares?" "fuck you I do"
 
@LightnessRacesinOrbit VS10 has offline help.
 
you can also download a copy of MSDN on your harddrive
 
9:59 AM
@R.MartinhoFernandes Re: your EXPAND answer: T[] can't be zero size.
 
@R.MartinhoFernandes ace
@Telkitty猫咪咪 I expect help to come with the application.
Anyway I'm pointing out a trend of behaviour from MS
 
@LucDanton Thanks.
 
@Telkitty猫咪咪 hii
 
@NipunGogia hello hello
 
how are you
??
 
10:07 AM
I am good, yourself?
 
i m fine tooo
seems you are too busy :)
 
indeed, you?
 
na i m not so busy ... but you are not online or view stackoverflow
:)
 
I am on this chat quite a bit still, although sometimes I think I should not be
 
hmmm
@Telkitty猫咪咪 anyways whats going at your end ...
 
10:11 AM
what do you mean?
 
means what are you doing these days ...
 
means busy in some php stuff
 
coding, hiking and fair a bit time upgrading hiking gears
 
ohooo cool
 
10:14 AM
no, java & objective C mainly
 
hey wanna ask somthing
?
 
ask, I might not answer
 
@LightnessRacesinOrbit So, if you add the switch, then T& t = T(); is illegal?
 
@chris GCC has had that for sooooooo long.
 
10:24 AM
god damn it! I Google something and get my own unanswered question as the first reponse
 
I have this suspicion, google has upgraded their search engine for fast indexing of Stackoverflow site
There used to be some delay on stackoverflow questions showing up on google search results. But for the past few days/weeks, the delay seems to be drastically reduced
 
lol some C++14 support in VC12
std::make_unique
 
Apparently, some people had never heard of "variadic".
That's not a new word, is it?
 
For some people it is.
 
@Telkitty猫咪咪 do you have android stuff on which i can merge???
 
10:27 AM
huh
I don't see std::make_unique in <memory> in VC12
 
@NipunGogia merge?
 
is it in a different header?
 
means i can do work on that
@Telkitty猫咪咪 means i can do work on that....
 
Current client on wants app on iphone, so is the next potential one
although they might also want an Android version later on
 
@Telkitty猫咪咪 need to work on new stuff so thats why i am asking
 
10:31 AM
If you design your project structure so that namespaces map to directories and classes map to files then that's clean. If you have a::foo and b::foo classes, then you have files a/foo.h a/foo.cpp b/foo.h b/foo.cpp. However, my IDE's header/source toggle function then toggles a/foo.h with b/foo.cpp if these are the only open files.
What a quandary.
And life sucks.
Prefixes ftw!
 
@Telkitty猫咪咪 i am very much interested in doing new stuff
 
@NipunGogia edited hope you have read my initial comment
 
@NipunGogia kinky stuff?
 
@Telkitty猫咪咪 actually right now means at present in my company i am working on javascript/web applications ... so i have a wide knowledge of these stuff and also have a knowlede of android as my main work is android in my company...
ya i read
 
btw
Rotate(range, n) = Drop(range, n) | Append(Take(range, n))
right?
 
10:38 AM
> configure: error: You need Python 2.x (...)
Fuck Python.
Thankfully Gentoo is awesome.
 
@Telkitty猫咪咪 there ??
 
> Derive specific std::function type from lambda to implement function wrapper
Not even gonna link to that.
 
go go std-asylum
 
@LucDanton Asylum?
 
No it's one of those 'I want the signature out of any functor' questions.
 
10:41 AM
Oh.
 
@DeadMG Append before drop feels safer.
@R.MartinhoFernandes You're a gentoo user?
All development and build servers at work run gentoo here.
 
@StackedCrooked Yes.
Script requires Python 2, but invokes it as python instead of python2.
 
I don't really have the patience to setup Gentoo. Still sticking with Ubuntu.
 
$ sudo eselect python set 1 makes python be Python 2, and it all works wonders.
 
Does gentoo have packages for recent GCC releases? (I thought they were rather conservative.)
 
10:45 AM
@StackedCrooked They are conservative in what gets tagged as stable, but new versions get added quick to repos (just not tagged as stable).
 
damn, I had a lot of std::moves.
 
did anybody watch stepanovs lectures on youtube ? I find him to be delusional old man, but i wonder what other think.
 
@DeadMG STD moves?
Your a smooth fella :D
 
@danilo2 No. No. No. — R. Martinho Fernandes 52 mins ago
 
@StackedCrooked wat
 
10:50 AM
@R.MartinhoFernandes Why did you say that? Do you think it's harmful to tell the OP how to write a constrained converting constructor?
 
hmm
I need to either just cut implicit conversions from Wide, or deal with actually having them be separate
 
26
A: Isn't the template argument (the signature) of std::function part of its type?

XeoThe problem is that both function<int()> and function<int(int)> are constructible from the same function. This is what the constructor declaration of std::function looks like in VS2010: template<class _Fx> function(_Fx _Func, typename _Not_integral<!_Is_integral<_Fx>::value, int>::_Type = 0); ...

@Xeo recommending signature inspection!
 
Man, plain Makefiles are so unpleasant to work with.
 
@LucDanton I had to fill in some minimum characters :S
 
Give me Autoconf/Automake/Libtool anytime.
 
11:00 AM
Oh okay. I'll write something up then.
@wilx My ethical code prevents me from doing that.
 
@LucDanton: The Bible? :)
 
wat
 
Xeo
@R.MartinhoFernandes Oh shi....!
I... uhm.. I... yeah, that was '11, I was drunk back then. Yes, totally.
 
> Please help me out as it will not only benefit me but the whole SOF community.
0
Q: Trouble understanding C code on loading database

user2527738OK, so for an assignment, I am studying a section of code from some project that loads a database. static int cli_tgzload(int fd, struct cl_engine *engine, unsigned int *signo, unsigned int options, struct cli_dbio *dbio, struct cli_dbinfo *dbinfo) { char osize[13], name[101]; char block...

 
user142019
Now I've contracted hemorragic e-coli from cleaning cow stalls and I'm bleeding out my asshole. I'll be dead soon, but that is a welcome relief. I will never have to program again.
 
11:04 AM
@Xeo You were drunk throughout all of 2011? Wow.
 
@R.MartinhoFernandes you weren't?
 
Xeo
@R.MartinhoFernandes Ugh, that code even uses C-style casts.
 
Haha, so much suck.
 
Xeo
I must have been drunk. Even when I didn't like alcohol back then.
 
lol
 
11:07 AM
Ok, I'll make the question more general. — inflagranti 1 min ago
I wanted him to make it more specific...
 
Xeo
Btw robot, you didn't react to my comment on your EXPAND answer yet. :P
 
he's ignoring you obviously
 
Xeo
Oh, I was wondering where you grabbed the link to the std::function question. Turns out it was linked in another recent question.
 
@Xeo paranoid
 
11:18 AM
damn, I hate references
it's surprisingly difficult to collapse them in all the right places.
 
hi folks
I just had an interesting talk with my colleague
Apparently my Github projects using OpenGL can be looked at as fishy by Intel
 
can we please ban the use of yoda-conditions?
 
@BartekBanachewicz why?
 
^ this?
 
@LightnessRacesinOrbit because it can be (a rather far-fetched, but w/e) a violation of Intellectual Property terms
 
11:24 AM
@BartekBanachewicz how?
 
@LightnessRacesinOrbit my code could be based on what I work on here
What's funny, it would be by far worse if I didn't use my real name
 
although they are unlikely to sue you unless you are making a fortune or become famous because of it
 
So the fact I use real name on SO is also actually helping me.
I've also added this to my profile
> All opinions stated in my comments and answers are my own, and not and are not connected to my employer's.
 
can you prove that you have started the project before you joined intel?
 
11:29 AM
@BartekBanachewicz get a crappy job maintaining some GPL project... :P
 
I am not an IP lawyer, but if you have started a Github project after you had joined intel and the project relates to what you are working on in Intel, then they have all the legitimate reason to take whatever legal action they feel like against you.
 
@BartekBanachewicz I thought you work on driver stuff there?
 
@NoSenseEtAl meh, if it's necessary I will try to get an official approval
@melak47 not on the driver itself
 
so, have you been stealing code from your employer?
 
...
The stuff I have to do is piling dangerously
and I still have the exam tomorrow
 
11:34 AM
@BartekBanachewicz Fuck that. No employer (or any other entity for that matter) should lay claim to my opinions, ever.
 
@Abyx finally I can make that thing bigger and read all that crap!
 
@R.MartinhoFernandes I wish it worked like that
 
But if you had started the project and the project was in decent shape before you have joined the Intel, and you feel you were hired part because of it, then you can bargain with your empoyer, either you keep the existing project or you shut it down with a pay rise ... or even better still sell the it to the employer (if you are lucky and very very good at negotiation) :p
 
Android.
@BartekBanachewicz Yes, it does. If you as the employer want to claim my opinions for yourself, you will not be my employer.
 
that's why self-documenting code is better than any documentation.
 
11:37 AM
@R.MartinhoFernandes ehh... I really got a lof of other stuff to worry about, and changing jobs is not really what I want now.
Anyway that's just a precaution.
 
@R.MartinhoFernandes I don't think they really want to claim your opinions, it's probably more that they don't want your opinions reflecting on them (say you are complaining about people from a partner company of your employer being incompetent - your employer might not want your opinion being attributed to them)
 
@melak47 And that shows lack of trust. No, thanks.
 
also, named output arguments are better than return values, e.g. void process_some(bool& cancel) is better than bool process_some()
 
@melak47 And if they don't want my opinions as theirs, then let them state that themselves. I don't work in PR.
 
Hello
@R.MartinhoFernandes, you pointed me in the right direction.
 
11:43 AM
@JohanLundberg and where was that
 
@R.MartinhoFernandes Not to mention the "asynchronous" bit.
@R.MartinhoFernandes It's more a case of third-parties assuming that your opinions are those of your employer, and your employer claiming indirect libel.
 
@melak47 R commented on my question
 
@R.MartinhoFernandes It's not about them trying to claim that your opinions are theirs.
 
Well, it could always be stated in readme file that the work in Github is not related to ones workplace but as a hobby
 
11:47 AM
hmmm
I hate it when you come back to working on something after a break and then it seems like everything is way more broken than you remember
 
@Telkitty猫咪咪 hey sorry for late reply ...i have to go urgently
@Telkitty猫咪咪 so whats your gtalk id
or gmail
id
 
As long as it is written in a appropriate place that the code does not reflect the opinion of Intel, it should be fine.
Also it must not be worked on during working hours you have at Intel
 
@Telkitty猫咪咪 hey
 
@Telkitty猫咪咪 You know his contract?
 
0
Q: Ways to avoid/lessen the pain of the return value check after every single function call?

einpoklumIn languages and/or libraries which do not support exceptions, many/almost all functions return a value indicating success or failure of their operation - the best-known example being perhaps UN*X system calls such as open() or chdir(), or some libc functions. Anyway, when I write C code, it ver...

lol
C
 
11:51 AM
@R.MartinhoFernandes No, but would it be reasonable to assume it is a general software engineer contract not modified one?
 
JBL
@not-TonyTheLion The first comment is actually the best answer too :p
 
@Telkitty猫咪咪 isn't it usually "anything you work on/think of/talk about/drop in the toilet during work hours is property of your employer" or some crap like that? :/
 
@JimBalter C is a modern programming language. — H2CO3 29 secs ago
ahahahahaha
 
@Telkitty猫咪咪 that doesn't matter
 
The joke of the century.
 
11:53 AM
@Telkitty猫咪咪 that's correct, and rather obvious
 
@BartekBanachewicz I am not sure about poland, but if you are sued, you could always argue that you have take reasonable care to inform the users that the code reflects your own opinion
 
sbi
You are @not-TonyTheLion!
 
True.
I'm not-TonyTheLion.
 
sbi
> If German were a light, airy, vowel-dominated language, would things have gone differently? — Joyce Carol Oates
 
@Telkitty猫咪咪 so what to do
should i give you mine id
 
11:57 AM
@NipunGogia send me a message
I am off for a jog :p
 
No, no citation is needed, an education is needed. — Jim Balter 20 secs ago
 
@R.MartinhoFernandes Wait, I saw unspecified bool type and instantly thought of operator bool() for istream. That might have been a bit of a leap.
 
@chris They have a conforming std::string implementation? :P
 
My original comment was also correct, no matter how much it offends you to point out that C is not a modern programming language. — Jim Balter 1 min ago
:D
butthurt incoming
 
JBL
That question turned so fast into a language war...
 
12:11 PM
Everything mentioning C is a war.
 
aaand the comments are gone
 
sbi
LOL, I was waiting for this to happen.
 
same here.
@sbi Well you can't expect a reasonable discussion with a C zealot; they are not reasonable by definition.
 
sbi
@BartekBanachewicz Yeah, there's no exceptions, right?
:)
 
12:14 PM
dat pun
 
oh god I am so bad at noticing puns.
 
I thought that the question was reasonable. Being advised to use a 'modern' language with exception handlers is not much use if no such language is available for your development environment.
 
There's no indication this is a crappy environment
 
@Telkitty猫咪咪 er.nipungogia@gmail.com my email id
 
> So my answer is either stick to solve issues where nothing (or few) can fail, or take the burden of accepting that handling error conditions is part of the solution.
What.
 
12:17 PM
You can always use goto
 
user142019
Just assume everything goes right.
 
@CatPlusPlus Indeed, but there is no indication that it isn't, either.
 
Or longjmp
 
longjmp fucks with foreign frames.
 
sbi
@BartekBanachewicz That wreaks havoc with cleanup code.
 
12:18 PM
Don't use longjmp.
 
@MartinJames The primary issue here being that there is no other sane advice. If C had a solution to this problem, exceptions would not have been invented.
 
@MartinJames if we were to assume evreryone is constrained with 512kB of ROM and 8Mhz CPU, we couldn't give 95% of SO a reasonable answer
 
@MartinJames That's true, but crappy environments are massively the minority.. if he's in a crappy environment he should say so.
 
Yeah well you can also not use C, but who cares if you can use goto and longjmp. Seriously guys.
 
goto is the solution to this particular problem.
longjmp is just bad.
 
12:19 PM
@CatPlusPlus you should ask @H2CO3 about that
 
Please don't.
That guy is a pompous zealot.
 
user142019
C-alot.
 
JBL
Gosh, sniped.
 
Meh, it implies See-A-Lot, which in this case is obviously false.
 
12:21 PM
@BartekBanachewicz About what?
 
I have several, (legacy), crappy environments to maintain:( I do agree, though, if I was posting a question like that, I would probably tag it with 'Embedded' and add 'Please don't advise me to use another language - it is not an option in my environment'.
 
@CatPlusPlus nothing, really. fuck C. and longjmp in particular.
 
Like I'd expect a C programmer to know why longjmp is bad.
 
12:21 PM
@MartinJames Maximum Question Munch Rule! :D
 
user142019
longjmp is fun.
 
If you call yourself a MAster you shall be able to handle this... - but you are right, I do not like to use it. Too stressy. — alk 28 secs ago
What is this guy smoking
 
@rightfold for very specific definition of fun
 
user142019
@CatPlusPlus longjmp man page.
 
@CatPlusPlus WTF
 
12:22 PM
I made the question more specific to the actual problem I'm trying to solve and added that the solution could be completely different from what I've tried so far. — inflagranti 1 hour ago
@R.MartinhoFernandes It worked!
 
What is this longjmp that I have never heard of?
 
@Pawnguy7 don't ask. move along.
 
Nothing. Go back to your room kid.
 
@CatPlusPlus What
 
Haha.
 
12:23 PM
@LucDanton Cool.
 
user142019
 
0
A: Function wrapper that works for all kinds of functors without casting

Alexso you want to decorate a std::function with std::weak_ptr? you can look into this loosely related question. I don't see why you are not storing the weak pointer itself and write a wrapper that calls weak_ptr::expired()? Something like the thing below (I haven't checked yet): #define RUN_WEAK...

o_O
FFS
 
#define RUN_WEAK_PTR(WPTR, ...) \
  do { if (!(WPTR).expired() { (*WPTR).operator()(__VA_ARGS__); } } while(0)
 
It's basically a thin wrapper over unconstrained CPU jump instruction.
 
12:24 PM
Jumps like that were bad 40 years ago and they're still bad.
 
user142019
@BartekBanachewicz headshot
 
Plus, if you happen to pass through foreign frames, UB.
 
user142019
I recall somebody using longjmp to end a recursive function. :D
 
And now you can't reason about your code at all, because you can't guarantee there won't be frames that invoke UB when longjmp'd over.
 
@BartekBanachewicz No problem - I 'll send you my legacy C code for you to debug. That should work. My preferred alternative is to jump from a high building.
 
12:26 PM
Congratulations, you're a bad programmer. Have a cookie.
 
user142019
> longjmp() and siglongjmp() make programs hard to understand and maintain. If possible an alternative should be used.
 
No one should object to you're mentioning goto ... it's a modern feature of modern structured assembly languages like C. — Jim Balter 9 mins ago
 
user142019
Even the man page says it's terrible LOL.
 
Anyone writing an answer? I may write one myself if no one does, but not right now.
 
structured assembly :D
 
JBL
12:28 PM
I stopped at "modern feature".
 
I'm not going to try. If I did, I would probably end up jumping off the high building myself, so forming another splat next to the squashed banana sandwich.
 
> How can C Programs be so Reliable?
Ahahahaha
AHahahahahahahaha
 
that's "ahaha" sound one makes before stabbing someone with a butcher knife
 
Reliable C programs do exist. The snag is, getting all the bugs out requires 6 years instead of 6 months.
 
@CatPlusPlus What are you reading?
 
12:30 PM
2
A: Ways to avoid/lessen the pain of the return value check after every single function call?

ctnTry to approach this problem with a sort of scientific curiosity. There are many that claim that this approach leads to programmers being more aware of error conditions and this leads to more attention to errors and where/how they should be treated. Just consider this an exercise (if a bit tediou...

Linked thing.
 
> Don't fight it. Solve this as much as possible in the spirit of C and your view of things will expand slightly.
aha that's from it
 
Why is this industry full of fucking masochists, I will never understand.
 
@BartekBanachewicz - yeah, I forgot about the butcher knife. Another decent alternative to C development :)
 
> after all, C is little more than a high-level assembly language.
at least he is honest
 
It's like car manufacturer insisting on assembling every unit manually.
 
12:32 PM
@CatPlusPlus I am not a masochist - I am being unwillingly tortured by my customers.
 
> The first observation is semi-obvious. Because software written in C can fail in so many ways, I was much more careful than normal when writing it.
what the fuck kind of argument is that.
 
@CatPlusPlus WTF dude.
> I've been an OpenBSD user for 9 years or so, and software doesn't get much better than that
 
Just :psyduck:
 
When your old boss hired someone with 20 years commercial software development experience, and they probably earn thousands more than you do, but they cannot get their head around a basic backport and patch release.
 
JBL
12:37 PM
@MartinJames But I am. I truly enjoy C++. Yes, even I don't understand.
There are masochists...
 
@LightnessRacesinOrbit Recent personal life event?
 
@R.MartinhoFernandes Five minutes ago
 
Xeo
Hmmm.... what is determinging where Vim jumps with ctrl-arrows and shift-arrows?
 
Mental Health Act 1983: 'A common reason given for involuntary commitment is to prevent danger to the individual or society. People with suicidal thoughts may act on these impulses and harm or kill themselves. People with psychoses are occasionally driven by their delusions or hallucinations to harm themselves or others. People with certain types of personality disorders can occasionally present a danger to themselves or others, eg. developers who use C when alternatives exist'.
4
 
@Xeo No fish for you. Have a fishing pole: :help <S-Left>
 
12:44 PM
Oh IntelliSense, y u so smart
 
lol
 
can't they just give up and use clang for intellisense? :p
 
hell, why not just replace their compiler with Clang
 
@DeadMG then we'd at least get a working windows stdlib for clang? :D
 
I just wrote receiveButter instead of receiveBuffer.
 
12:54 PM
that would be nice
 
Kinda.
 
@StackedCrooked you hungry by any chance?
 
I should put butter on my sandwiches. I never do that.
 
Xeo
You never butter your bread with butter?
Err... you need to use shared_from_this, not new. (Polite programmers never use new in public.) — Kerrek SB 3 mins ago
lol
 
@DeadMG it could really boost VS sales AND cut costs at the same time
 
12:56 PM
Wide commit log
> Removed the move special member from the global namespace with Standard.Utility.Move, which currently copies.
 
Objective-VisualC++
 
@Xeo If rarely butter my bread with butter.
 
og fucking god
@BartekBanachewicz No pain, no gain: psychologytoday.com/blog/memory-medic/201106/…ctn 5 mins ago
So using C is actually inflicting pain on yourself on purpose!
@BartekBanachewicz: I disagree - longjmp() fills the void between status codes/errno and exit()/abort(), and becomes particularly useful if callbacks are involved — Christoph 14 mins ago
too many morons for one day.
 

« first day (985 days earlier)      last day (3978 days later) »