Hi Warren,
Warren Young wrote:
> Brad Hubbard wrote:
>> mysqlpp::Null<mysqlpp::sql_char>, mobileNumber,
>
> ...snip...
>
>> mysqlpp::String &mob = it->mobileNumber;
>
> You mean either:
>
> mysqlpp::Null<mysqlpp::String> &mob = it->mobileNumber;
>
> or:
>
> mysqlpp::String &mob = it->mobileNumber.data;
But I thought this;
operator Type&()
{
if (is_null)
return data = Behavior::null_is();
else
return data;
}
in null.h must be how you "safely" get the data member. You'll notice in
my original post I have a line where I access data directly and I
realise it is public but I thought there must be some type of "accessor"
method.
>
> Actually, you don't have to use references if you don't want to.
> mysqlpp::String has reference-counted copies, so they're cheap.
>
> Also, I would use mysqlpp::sql_char here instead of String, just to
> avoid confusion.
>
So would you mind showing me the recommended way to access the
underlying string "safely" please?
Thanks for your input,
Brad