From: Ivan Molella <i.molella@reply.it>
To: gcc@gcc.gnu.org
Subject: compiler confusion?
Date: Wed, 23 Apr 2003 13:29:00 -0000 [thread overview]
Message-ID: <5.1.1.6.2.20030423140157.027cee48@pop3.reply.it> (raw)
i' have the follwing problem:
I' have the following assertion class:
template<class Excp>
class Assert
{
public:
typedef Excp exception_throwed;
Assert(bool val, const char* msg_throwed, long code)
: value(val), message(msg_throwed), excCode(code)
{ }
Assert(bool val, string msg_throwed, long code)
: value(val), message(msg_throwed), excCode(code)
{ }
void do_assert()
{
if (!(value)) throw exception_throwed(message, excCode);
}
private:
bool value;
const string message;
long excCode;
};
when i use this assertion in the following code:
void
telnetClient::init(const string pTelnetProg,char* const* pArgs,char*
const*pEnv,int _timeout) {
.....
31> Assert<telnetClientException>((checkProcessStatus() ==
telnetClient::process_running),"[MM CO=EBEX_TELNET_L0016
MM]",PROCESS_DOWN_ERROR).do_assert();
....
}
i have the following error:
telnetClient.cpp: In member function `void
telnetClient::init(std::basic_string<char, std::char_traits<char>,
std::allocator<char> >, char* const*, char* const*, int)':
telnetClient.cpp:31: parse error before `==' token
while if i do:
void
telnetClient::init(const string pTelnetProg,char* const* pArgs,char*
const*pEnv,int _timeout) {
.....
31> Assert<telnetClientException>((this->checkProcessStatus()
== telnetClient::process_running),"[MM CO=EBEX_TELNET_L0016
MM]",PROCESS_DOWN_ERROR).do_assert();
....
}
compilation is done without any error.
What's the matter with the first expression?
Thanks in advance.
checkProcessStatus is so defined:
bool
telnetClient::checkProcessStatus()
{
if (task.isAlive()==telnetClient::process_terminated){
return telnetClient::process_terminated;
}
return telnetClient::process_running;
}
Ci sono 10 categorie di persone:
quelli che sanno contare in binario e tutti gli altri.
next reply other threads:[~2003-04-23 12:21 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-04-23 13:29 Ivan Molella [this message]
2003-04-23 15:46 Ivan Molella
2003-04-23 16:03 Ivan Molella
2003-04-24 15:12 Gareth McCaughan
2003-04-25 9:00 ` wilson k.j
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5.1.1.6.2.20030423140157.027cee48@pop3.reply.it \
--to=i.molella@reply.it \
--cc=gcc@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).