List:MySQL++« Previous MessageNext Message »
From:Warren Young Date:April 30 2010 7:11am
Subject:Re: create a Null field
View as plain text  
On Apr 30, 2010, at 12:54 AM, Andrej van der Zee wrote:

> Thank you for your reply. That I tried but get the following (I am using 3.08):
> 
> /usr/local/include/mysql++/null.h: In member function ‘void
> parsers::ip::dbdump()’:
> /usr/local/include/mysql++/null.h:55: error: ‘mysqlpp::null_type::operator
> CannotConvertNullToAnyOtherDataType() const [with CannotConvertNullToAnyOtherDataType =
> unsigned int]’ is protected

Ah, static typing.  Gotta love it.  You'll have to do it with if/else instead of the
alternation operator:

	if (h)
		db_host_id = h->_db_host_id;
	else
		db_host_id = mysqlpp::null;

That's *somewhat* cleaner than your current code.
Thread
create a Null fieldAndrej van der Zee30 Apr
  • Re: create a Null fieldWarren Young30 Apr
    • Re: create a Null fieldAndrej van der Zee30 Apr
      • Re: create a Null fieldWarren Young30 Apr