Subject: Null values do not compile... 2007-10-02 - By Maarten Schrijvers
Back I have some fields which can be (SQL) NULL. If they are filled they are varchar, but they're not necessary, so they could be NULL. Compiling gives me an error though:
c:\mysql++\include\null.h(206) : error C2593: 'operator =' is ambiguous
1> E:\Program Files\Microsoft Visual Studio 8\VC\include\xstring(923): could be 'std::basic_string<_Elem,_Traits,_Ax> &std::basic_string<_Elem,_Traits,_Ax>::operator =(_Elem)'
1> with
1> [
1> _Elem=char,
1> _Traits=std::char_traits<char>,
1> _Ax=std::allocator<char>
1> ]
1> E:\Program Files\Microsoft Visual Studio 8\VC\include\xstring(918): or 'std::basic_string<_Elem,_Traits,_Ax> &std::basic_string<_Elem,_Traits,_Ax>::operator =(const _Elem *)'
1> with
1> [
1> _Elem=char,
1> _Traits=std::char_traits<char>,
1> _Ax=std::allocator<char>
1> ]
1> E:\Program Files\Microsoft Visual Studio 8\VC\include\xstring(913): or 'std::basic_string<_Elem,_Traits,_Ax> &std::basic_string<_Elem,_Traits,_Ax>::operator =(const std::basic_string<_Elem,_Traits,_Ax> &)'
1> with
1> [
1> _Elem=char,
1> _Traits=std::char_traits<char>,
1> _Ax=std::allocator<char>
1> ]
1> while trying to match the argument list '(mysqlpp::sql_varchar, mysqlpp::null_type)'
1> c:\mysql++\include\null.h(204) : while compiling class template member function 'mysqlpp::Null<Type>::operator Type(void)'
1> with
1> [
1> Type=mysqlpp::sql_varchar
1> ]
1> e:\visual studio 2005\projects\t_1\urenregistratie\Relatieonderhoud.h(25) : see reference to class template instantiation 'mysqlpp::Null<Type>' being compiled
1> with
1> [
1> Type=mysqlpp::sql_varchar
1> ]
I have declared the following:
typedef mysqlpp::Null<mysqlpp::sql_varchar> Nullstr;
static Nullstr vVoornamen = mysqlpp::null; //gave the variable a value trying to avoid the error
What am I doing wrong?
|
|