Warren Young schreef:
Bart Verstraete wrote:
void lfDbStaticText::SetLabel(mysqlpp::Null<mysqlpp::cchar*>& label) {
#ifdef DEBUG
std::cerr << label << std::endl;
std::string testlabel = (label.is_null ? "" : std::string(label)); //
You're reinventing the "NullisBlank" wheel here. (Read the user
manual section on handling SQL nulls.) Also, I doubt cchar* is the
right thing here: who manages the memory it points to? I would define
this parameter as:
mysqlpp::Null<std::string, mysqlpp::NullisBlank>
instead.
I don't understand your comment. About using std::string instead of cchar*