MESSAGE
DATE | 2011-03-15 |
FROM | Ruben Safir
|
SUBJECT | Subject: [NYLXS - HANGOUT] [ruben@mrbrklyn.com: Re: this compared to NULL]
|
----- Forwarded message from Ruben Safir -----
Date: Tue, 15 Mar 2011 15:44:02 -0400 From: Ruben Safir To: Billy Cc: Ruben Safir Subject: Re: this compared to NULL User-Agent: Mutt/1.5.20 (2009-06-14)
On Tue, Mar 15, 2011 at 01:06:56PM -0400, Billy wrote: > You're trying to return NULL from a method that returns MESSAGE. > > That's not going to work. > It has nothing to do with the comparison: this==NULL > This would be clear if you used newlines in your code. > > There's no great advantage to squishing a method onto one line, > and it makes diagnostics harder to pinpoint. >
Yeah - I debugged it to that problem by doing exactly as you said and breaking it up on multiple lines. But now I'm perplexed as to the best solution.
I think that this is best fixed using a cast in the LIST object and then I need to add a constructor for an integer for MESSAGES.
I was going to see how the strings library does this and maybe emulate that.
There is another puzzle that is bothering me. I had a bug that the compiler didn't pick up and I don't know why.
The method value originally ended with a semicolon, which is something only a class should do, and nothing complained and everything initially worked (I initially just yanked the declaration from the Class and forgot to remove the semicolon). I believe that becuse it is a template class that this error wasn't picked up, bt I'm not certain how this affected the original code.
Ruben > > On Tue, Mar 15, 2011 at 2:17 AM, Ruben Safir wrote: > > I just realized you don't have the MYSQL setup, but here is the compiler > > output > > > > || g++ ? -Wall -ggdb -I/usr/local/include/mysql > > -I/usr/local/include/mysql++ -c linklist.cpp > > || g++ ?-Wall -ggdb -I/usr/local/include/mysql > > -I/usr/local/include/mysql++ -c linklist_main.cpp > > || In file included from linklist_main.cpp:1: > > || linklist.h: In member function ?unk CHAINLIST::NODE::value() > > [with unk = MESSAGE]?: > > linklist.h|154| instantiated from ?void > > CHAINLIST::LIST::display(std::ostream&) [with unk = MESSAGE]? > > linklist_main.cpp|312| instantiated from here > > linklist.h|43| error: conversion from ?int? to non-scalar type ?MESSAGE? > > requested > > || make: *** [linklist_main.o] Error 1 > > > > > > On Tue, Mar 15, 2011 at 01:59:08AM -0400, Ruben Safir wrote: > >> Try to compile this. ?It seems to be telling me that I can't compare > >> this to NULL which it has done just fine with the string<> library > >> and otherwise. > >> > >> I'm at a loss to the problem. > >> > >> Ruben > >> -- > >> http://www.mrbrklyn.com - Interesting Stuff > >> http://www.nylxs.com - Leadership Development in Free Software > >> > >> So many immigrant groups have swept through our town that Brooklyn, like Atlantis, reaches mythological proportions in the mind of the world ?- RI Safir 1998 > >> > >> http://fairuse.nylxs.com ?DRM is THEFT - We are the STAKEHOLDERS - RI Safir 2002 > >> > >> "Yeah - I write Free Software...so SUE ME" > >> > >> "The tremendous problem we face is that we are becoming sharecroppers to our own cultural heritage -- we need the ability to participate in our own society." > >> > >> "> I'm an engineer. I choose the best tool for the job, politics be damned.< > >> You must be a stupid engineer then, because politcs and technology have been attached at the hip since the 1st dynasty in Ancient Egypt. ?I guess you missed that one." > >> > >> ? Copyright for the Digital Millennium > > > > > > > > -- > > http://www.mrbrklyn.com - Interesting Stuff > > http://www.nylxs.com - Leadership Development in Free Software > > > > So many immigrant groups have swept through our town that Brooklyn, like Atlantis, reaches mythological proportions in the mind of the world ?- RI Safir 1998 > > > > http://fairuse.nylxs.com ?DRM is THEFT - We are the STAKEHOLDERS - RI Safir 2002 > > > > "Yeah - I write Free Software...so SUE ME" > > > > "The tremendous problem we face is that we are becoming sharecroppers to our own cultural heritage -- we need the ability to participate in our own society." > > > > "> I'm an engineer. I choose the best tool for the job, politics be damned.< > > You must be a stupid engineer then, because politcs and technology have been attached at the hip since the 1st dynasty in Ancient Egypt. ?I guess you missed that one." > > > > ? Copyright for the Digital Millennium > > > > > > -- > ?n??uop ?ll?q
-- http://www.mrbrklyn.com - Interesting Stuff http://www.nylxs.com - Leadership Development in Free Software
So many immigrant groups have swept through our town that Brooklyn, like Atlantis, reaches mythological proportions in the mind of the world - RI Safir 1998
http://fairuse.nylxs.com DRM is THEFT - We are the STAKEHOLDERS - RI Safir 2002
"Yeah - I write Free Software...so SUE ME"
"The tremendous problem we face is that we are becoming sharecroppers to our own cultural heritage -- we need the ability to participate in our own society."
"> I'm an engineer. I choose the best tool for the job, politics be damned.< You must be a stupid engineer then, because politcs and technology have been attached at the hip since the 1st dynasty in Ancient Egypt. I guess you missed that one."
? Copyright for the Digital Millennium
----- End forwarded message -----
|
|