« first day (570 days earlier)      last day (4379 days later) » 

12:00 AM
ok, so i understand this
the decltype(a>b) of the return of a>b is what cases the recursion
causes*
 
even MORE odd, if you define both operators, NEITHER ONE OF WHICH IS CONST, and use them as a trailing type def, all three compilers are perfectly fine with it for some reason
struct A { int a; bool operator<(const int& inty) { return a < inty; } bool operator>(const int&inty) { return a > inty; } }; template <class A, class B> auto operator<(const A& a, const B& b) -> decltype(a>b) { return a < b; } int main(void) { A a; a.a = 1; int b = 2; if (a < b) return 4; return 0; }
@johnathon which versionare we speaking of? the one MSVC runs, the one that kills all compilers, or the one that all compilers shouldn't compile but do?
 
all 3.
 
well they each have different kinds of recursion matched with different trailing typedefs
 
and which is something im trying to wrap my head around :))
 
if @Xeo was around he'd be very interested in that 3rd one
 
12:05 AM
Im sure.
Im interested in all 3
:))
 
is there some part you want me to explain? I find bad code is a good learning experience
 
yea, i want to know exactly how your making the compiler recurse
 
OK
let's start with the original offender
struct A {
  int a;
  bool operator<(const int& inty) { return a < inty; }
};

template <class A, class B> auto operator<(const A& a, const B& b) -> decltype(a<b) { return a < b; }

int main(void) {
  A a;
  a.a = 1;
  int b = 2;
  if (a < b) return 4;
  return 0;
}
you mentioned a thought about it before, what was it?
 
that the decltype of a<b on the return of a<b was the recursion, but that the auto was causing template type decution rules to override the recursion more or less
more to the point, which it shouldent, because the types were incompatable
 
are you saying that it was stuck figuring out the auto without being able to figure out the operator<
 
12:11 AM
otherwise, by defnition, you could compare the struct to a sting object
 
well, you can do any operator< you want
I could do
bool operator<(std::string& a, double b)
 
yea
and bool operator >
and bool operator what ever
 
templatizing that simply...templatizes it
 
i understand that
when i write templates, i use them for mix in's , in wtl, or things of that nature
i Don't try to figure out the full semantics of how it works. i just know it does. it's a tool in my toolbox. like, a volt meter to an electrician, they know it tells them the voltage, but they couldn't tell you how the circutry in the thing does so
 
I thought you were interestedi n it :-P
 
12:15 AM
i am
im just giving you a better perspective on my template skills :P
@stdOrgnlDave so guidance, is appreciated ;)
 
void f3() {
float x, &r = x;
[=] { // x and r are not captured (appearance in a decltype operand is not an odr-use)
decltype(x) y1; // y1 has type float
decltype((x)) y2 = y1; // y2 has type float const& because this lambda
// is not mutable and x is an lvalue
decltype(r) r1 = y1; // r1 has type float& (transformation not considered)
decltype((r)) r2 = y2; // r2 has type float const&
};
}
@stdOrgnlDave what i was saying is, or tried to say is, explain to me the whole concepts as i don't understand them as deeply as you do
ah..
decltype in ms , was implemented before the standard was released, and doesn't follow the standards rules for type deduction, hence your edge case with the ms compiler. Makes me wonder, have you tried to compile it on 11 yet?
 
12:45 AM
I have to go for he night
for a bit at least
VC11 exhibits exact same behavior with supposedly standards-compliant version of decltype
 
ah
well good night
maby sometime in the future you could have a nice session or some direction to information on meta-programming
 
1:11 AM
Hi there
 
allo
 
2:09 AM
hola again guys
ohhhhh no1 here now :) my baaaddddddddd
 
:(
 
2:33 AM
aaaahhhhhhhhh i see :) makes sence though as most answers i have seen on stackoverflow have been asnwered by europeans
 
2:45 AM
is anyone there ?
can i ask a question about vector if anyone is here ?
 
user406009
I am here(not that it means much).
 
@EthanSteinberg can i pick your brain about using std::vector
 
user406009
Sure.
 
user406009
Well, what did you want to ask about?
 
thx .. here is the jist of what i want to do .... I have a vector<Process> and a vector<MasterProcess> ... both Process and MasterProcess have int IDs .... User supplies the Processes which are stored in the vector .... and Master Processes are also stored in the vector
 
user406009
2:57 AM
Seems pretty standard.
 
what i want to do is ... for every Prcoess Object in vector<Process> , compare the processID with the ID of object in vector<MasterProcess> .. if found send both objects to another function to do stuff
can i do this with find ... or do i have to use find_if ???
actually i have tried both .. but both of them give me errors
 
user406009
Seems like the better solution would be to have Process store a pointer to MasterProcess.
 
Is there an operator== that can compare both Process and MasterProcess?
If not, it's a job for std::find_if.
 
operator == ... i have defined it in class Process .... let me paste the definition here
actually in class MasterProcess
 
user406009
You might want to show us what you have so far on something like ideone.
 
3:02 AM
Process proc_vector
MasterProcess::iterator m_p_pos1
for (int i=0; i<proc_vector.size(); ++i)
{ m_p_pos1 = find (m_proc_vector.begin(),m_proc_vector.end(),(proc_vector.at(i)).getProcessID());
if (m_p_pos1 != m_proc_vector.end()) {
// Item found
// doThis()
}
else
{
// Item not found
// doThat()
}
and the code for operator == in MasterProcess is as follows:

bool operator == (const MasterProcess& str) const
{
return (m_processID == str);
}
 
You might be interested in the newbie hints (link to the right) on how to post code.
 
Process proc_vector
MasterProcess::iterator m_p_pos1
for (int i=0; i<proc_vector.size(); ++i)
{ m_p_pos1 = find (m_proc_vector.begin(),m_proc_vector.end(),(proc_vector.at(i)).getProcessID());
if (m_p_pos1 != m_proc_vector.end()) {
// Item found
// doThis()
}
else
{
// Item not found
// doThat()
}
 
@Atif that much code does not go in chat. ideone.com
 
there you go ... sorry just learned how to show code correctly
what i want to do is ... for every Prcoess Object in vector<Process> , compare the processID with the ID of object in vector<MasterProcess> .. if found send both objects to another function to do stuff ... But its giving me errors
 
user406009
Seems to work perfectly fine on my end: http://ideone.com/hBc33
You are going to need to tell us what errors.
 
3:16 AM
@EthanSteinberg .... let me check quickly
 
If all the raindrops were lemon drops and gumdrops. Oh what a rain that would be.

All vegetation would shrivel up due to lack of water. There would be no rice. The employees in the Foxconn factories in China where they make iPads would starve to death.

No iPads. What a rain indeed.
 
Quick question: can someone describe the purpose of fflush to me? I've been programming in C for awhile, but this is one function I cannot seem to understand...
I've read the man and googled, too
 
3:31 AM
@EthanSteinberg constructor error ... you specified only one argument in the constructor, whereas in my code the default constructor for MasterProcess() has 5 values (int,int, double, double, double)
so its expecting 5 arguments instead of just one id
but i just want to compare the id as it distinguishes the object
ohhhhh i can probably create another constructor with only one argument
 
user406009
That would be a case for find_if.
 
you mean i do the same thing in find_if ... and the function it takes simply performs the same thing performed by the == operator ?
 
user406009
Yep.
 
user406009
You are right though, a one-item constructor would probably be simpler though.
 
let me try both quickly and see if they both can get the same result
the constructor method worked .... not let me try if i can get find_if working
now*
 
user406009
3:39 AM
Here is an example of find_if if you get stuck: ideone.com/GN4rc
 
user406009
Somewhat annoying due to having to create a whole separate class.
 
user713867
3:50 AM
Hi.. is anyone there?
 
user713867
Have something to clarify on pthreads.
 
@EthanSteinberg ... yeah i kinda got stuck on find_if ... looks like there is no way of doing it without creating a new class
 
user406009
AFAIK there are three "easy" ways of using find_if: 1). Create a new class. 2). Use boost::function type magic. 3). Use C++11 lambas.
 
user406009
Like this: ideone.com/1obv0. Sadly that won't work on 99% of the compilers you will end of having to use.
 
i have gcc 4.6.1 ... so it works :)
but regarding the new constructor approach, if i use the new constructor (with one argument) , would it not give me a new object instead of the object that i want (created using 5 arguments)
 
user406009
4:02 AM
You are right, you are using a "fake" object in the find statement. Not that it matters as long as it compared equals to the "real" object that you are looking for. The return value would be the "real" object.
 
sbi
@thecoshman Funny. And it took me three tries to finally be able to see what happened to the left child.
 
yeah the return object (that i would supply in the do this() would be the real one ... so i guess its a hack that works :)
@EthanSteinberg thanks so much bro ... TIL how to use find/find_if correctly ... and i have to read more about lambda's as it seemed a nice way of getting work done
 
5:07 AM
@sbi Which confirms its message :)
 
 
1 hour later…
6:13 AM
@ScottW Hi can I ask a really quick question on caching as I need to go out now
I want to cache items, but not sure whether to cache the results of the query or the lines from the text file in which the results were obtained.
So I can reuse that cached item for further querying
 
sbi
6:48 AM
@StackedCrooked Interestingly, I have never been in a situation like this. I'm not sure why. I will have to think about this.
 
Just joking :D
 
7:02 AM
Sbi, you can use the the jimmies rustled meme whenever you are grumpy.
*excuse the grammar
 
7:41 AM
it was: `/last sbi`
There, full disclosure especially for you
I keep not-remembering that the SO Chat userscript isn't installed on my work PC.
 
sbi
@sehe And what would that do?
 
morning all
 
@sbi Fetch the last message posted by a user, in this case 'sbi'. Underway (to work) I noticed you had responded to some animated gif and that was the quickest way to locate it :)
@sbi I do that all the time. Luckily the userscript has Ctrl-Space to retry immediately
 
Hey, I also graduated! (Ten years ago, but still...)
 
@StackedCrooked Well, you were awesome and stuff!
 
7:49 AM
@sehe Ah, that brings a tear to my eye.
 
Hah. It worked. I made stackedcrooked cry
 
Silently, because I'm at work.
 
sbi
@StackedCrooked Why? It wasn't that rude, was it?
 
It was so touching. After 10 years, a halfbaked congratulation. Made him think of how nice it would have been to get a real heartfelt one...
... then a sob-of-self-pity had to be suppressed
 
8:07 AM
That was quite a stylish message there that got flagged:
> hummm.. okay tell me what you want to do? and with whom?
 
sbi
8:22 AM
Reminds me of one of the Die Hard movies, where Bruce has this woman (operator?) with a great voice on the phone line, and asks "Can I do something for you? ... to you?" I always liked this play on words.
 
@sbi Do you mean Simon?
 
sbi
@GManNickG No, I meant Bruce. I even wrote his name.
 
"What can I do you for?" ; Another Great British English Idiom
 
Who's Simon?
 
@sbi I mean on the other end, you're sure it was a woman? Maybe it's my memory that's fuzzy, I don't remember Bruce talking to a woman with that line. But I've made mistakes I suppose.
 
8:27 AM
Recently
 
sbi
@sehe He might have asked that, in fact. I'm hazy on that. I just remember how he changed "for" into "to", and how that changed the meaning so completely.
 
@Pubby Antagonist in "Die Hard with a Vengeance".
 
Oh, never saw that one. I only know the Germans(?) from the first.
 
sbi
@GManNickG Um, I really don't know anymore, who was at the other end of the line. It was an attractive female voice, that I remember. It might have been DH4, but I am not sure of that either.
 
@sbi Oh wait, maybe the newest one.
 
sbi
8:31 AM
@GManNickG I dunno. Isn't DH4 the newest? The guy must be way past 60 now, after all.
 
@sbi Yeah, I should have said "oh yeah, maybe the newest one". Have only watched it once. Anyway, I should stop ruining this conversation.
 
sbi
This is a wonderfully confused Freudian slip. :)
@GManNickG You're not ruining anything. I have little else to talk about. If I wouldn't idly chat, I'd have to work. And you wouldn't want to risk that, would you?
 
@sbi Oh for sure.
 
9:03 AM
in random news: xkcdb.com/?8802
 
Ahoi
Is everybody suddenly having jobs? It is so silent round here, often
 
user1151738
Hi
 
user1151738
I have a question
 
user1151738
hello ?
 
9:11 AM
... patience
 
user1151738
yeah
 
...
 
user1151738
I am using libcurl
 
... yeah ask away
 
9:11 AM
Aha. Use libcurlpp. This is Lounge<C++> :)
 
user1151738
Dev-C++ ?
 
user1151738
is it avail for Dev-C++ ?
 
Good, no need to use C libraries. Regardless, what is your question?
 
user1151738
I am getting error
 
user1151738
errors, I should say
 
9:12 AM
@cadhityaa It is available for a language. The IDE is hardly relevant
 
user1151738
undefined erros :
 
user1151738
CURLOPT_USE_SSL\
 
user1151738
CURLOPT_USERNAME
 
user1151738
CURLOPT_PASSWORD
 
user1151738
CURLUSESSL_ALL
 
9:13 AM
stop it. We get it :)
 
user1151738
yeah
 
user1151738
How do I rectify ?
 
user1151738
I am linking correctly
 
0
Q: libcurl smtp mail undeclared error

c.adhityaaIn links here and here, the authors gives a simple tutorial to send mail via gmail. I have used curl for sometime now, but, I am getting undeclared errors for the following variables : CURLOPT_USERNAME, CURLOPT_PASSWORD, CURLOPT_USE_SSL, CURLOPT_MAIL_FROM, CURLOPT_MAIL_RCPT. I am sure I have incl...

Next time, just link to the question :)
 
user1151738
'Kay...Sorry
 
user1151738
9:15 AM
anybody going to answer that ?
 
Who knows?
 
Is there source code? We can't guess what you have.
 
user1151738
Exact source
 
Is there source code? We can't guess what you have. My guess is that those identifiers aren't variables in the first place. They'r problably defines for literals — sehe 41 secs ago
 
user1151738
9:16 AM
huh-uh...
 
user1151738
I know they are constants
 
user1151738
I included curl.h
 
user1151738
still getting the error
 
Old version of curl?
 
user1151738
I don't know ?
 
user1151738
9:18 AM
I dont know...
 
user1151738
I used Package Manager of Dev-C++
 
Old as heck compiler freaking out?
 
user1151738
lol
 
Dev-C++ is infamous for being way way outdated.
 
user1151738
I don't know how to install curl in VS2010
 
user1151738
9:19 AM
:(
 
@RMartinhoFernandes It is a ANSI C library. I don't suppose it would choke
@cadhityaa Just installed libcurl and compiled with g++ ./test.cpp -lcurl -- no problem
 
user1151738
I am still getting the errors
 
@cadhityaa Well. Duh. Did you change anything? Try a command line build. Or see whether you can see what commandline(s) it is using to compile.
 
user1151738
Why would I change anything ?
 
It is a pretty safe bet that we don't use DevC++ here and since we're not psychic too we're not going to be able see any of your problems unless you tell us more relevant things
 
user1151738
9:25 AM
Anyways, please guide me how to install in Visual Studio 2010
 
user1151738
I'll try using libcurl in VS2010
 
@cadhityaa No need to restate this every 10 minutes:
2 mins ago, by c.adhityaa
I am still getting the errors
 
@cadhityaa This chat is not a helpdesk. Which doesn't mean that you can't ask, but don't be surprised if your plea is met with indifference.
 
user1151738
Alright.. Sorry.. :/
 
9:26 AM
Not even indifference. I downloaded the source, installed libcurl and compile it using gcc under cygwin on windows :)
There's just nothing we can do without more information
 
We use libcurl on vs2010 as well. Works fine
 
huh, just found out that word supports use of shift+enter to not put a gape between paragraphs
 
@thecoshman That claim is wrong on many levels
It introduces a linebreak, as opposed to a paragraph break. The amount of gap it shows depends on your paragraph and line spacing settings, only
@thecoshman If you wanted to reduce the 'gap' between paragraphs, instead change the paragraph settings 'space before, space after'
(can't believe I'm giving MS Office support now)
 
9:31 AM
@RMartinhoFernandes Hey, I'm starting to use concept checking (once more), and I wanted your opinion on how such a declaration looks (the Requires bit together with the SFINAE).
 
The difference to EnableIf being that it makes hard errors, right?
 
Yes.
And that the concept checks are based on Boost.ConceptCheck's checks and don't look or feel the same as traits.
 
I like it. But it is a bit annoying that you have to make a function a template just for that.
 
Mmmh, I intended to use that syntax for template parameters for function templates. Otherwise there's still access to BOOST_CONCEPT_ASSERT -- although that's obviously not self-documenting in declarations.
 
I was thinking of member functions of class templates, for example. Sometimes they have additional requirements. But then, I think it being a template would only hurt for taking its address and for virtual stuff.
 
user1151738
9:40 AM
Uh... I built libcurl for Visual Studio, but VS2010 is also giving the same errors... Please help me...
 
@RMartinhoFernandes Yeah. No self-documentation here, but can still use BOOST_CONCEPT_ASSERT -- whether the hard-error trace is a win or not is really up to debate though.
 
Make sure you have the right version.
 
user1151738
@R. Matinho Thanks a lot !
 
@cadhityaa Either the curl headers or the source is wrong. As simple as that. Check both. MSVC is fine compiler, if you feed it correct code, most often it compiles it correctly :)
 
user1151738
9:45 AM
Yeah... Thanks a lot guys !
 
@sehe the 'styles' in this document are horrendously messed up
 
user1151738
lol... curl.h in 7.9.6 is around 26 kB and curl.h in 7.25 is 81 kB :D
 
user1151738
and I have been using 7.9.6
 
if I dared to change something, I am fairly sure the world would end
 
@cadhityaa According to that list I gave you, CURLOPT_USERNAME requires 7.19.1. I guess it's time for an update...
 
user1151738
9:48 AM
yeah.. I updated
 
user1151738
to the latest version
 
@thecoshman So? That doesn't change my statements
If you use that as an excuse to not use paragraph styling for it's intended use, it certainly won't be getting any better.
 
@sehe so what is shift+enter supposed to do in word?
 
@thecoshman As is usual in Word documents, right?
 
@thecoshman Huh? (a) you told me (b) it does it already, like it's supposed (c) I told you exactly before
 
9:52 AM
22 mins ago, by sehe
It introduces a linebreak, as opposed to a paragraph break. The amount of gap it shows depends on your paragraph and line spacing settings, only
 
Everyone I know always manages to completely fuck up the styles somehow.
 
May I recommend <Ctrl-Shift-C> (copy style/formatting) <Ctrl-Shift-V> (paste style/formatting), <Ctrl-Space> (set default formatting)
<Ctrl-Up>,<Ctrl-Down> navigate paragraphs. <Ctrl-Shift-Up>/<Ctrl-Shift-Down> select entire paragraphs
@jalf thx
Yay for MSWord userfriendliness. I think it comes from excess features and sloppy style control
 
To be honest, I don't blame Word. It doesn't get on my nerves when I have to use it.
It works nicely.
 
@ScottW MSWord is somewhat programmer friendly. I used to do my cleanups using VBA. Like, altering the page-setup and print settings for all sections in a documents in one go.
 
VBA is subjectively programmer friendly.
 
9:56 AM
@RMartinhoFernandes Precisely. I could do with some more clarity. I hate how the bullet/numering/heading styles of a paragraph are 'hidden/contained' only in a 'virtual' spot at the end of a paragraph. You need to paste formatting from/over that virtual position in order to manipulate stuff
 
@sehe you may :D
 
@RMartinhoFernandes It is more like the automation model that is somewhat programmer friendly
@thecoshman Those shortcuts are critical to my happiness in Word
Also, <C-S-F>, <C-S-P>, <C-S-S>, and a nice gimmick: <S-F3>
 
@sehe Oh, sure it has flaws. But I find it actually usable as long as no one else decides to come along and fuck up everything.
 
@RMartinhoFernandes You mean, it is a bit like C++ :)
 
word styles on my own, nice tool to really help you get down to writing the actual content
word styles working with others, the worst thing to happen to man since the invention off... erm... trying to think of something equally bad...
 
9:59 AM
Which almost always invariably happens, because said someone else "has more experience" in Word than I have (I use it probably less than once a year)
 

« first day (570 days earlier)      last day (4379 days later) »