Hi,

i am compiling the code in HP itenium server and i am getting an error.

"Filename.cpp", line 129: error #2308: more than one
instance of overloaded function "std::basic_string<_CharT, _Traits,
_Allocator>::assign [with _CharT=char,
_Traits=std::char_traits<char>, _Allocator=std::allocator<char>]"
matches the argument list:
function "std::basic_string<_CharT, _Traits,
_Allocator>::assign(const std::basic_string<_CharT,
_Traits, _Allocator> &) [with _CharT=char,
_Traits=std::char_traits<char>,
_Allocator=std::allocator<char>]"
function "std::basic_string<_CharT, _Traits,
_Allocator>::assign(_Allocator::const_pointer) [with
_CharT=char, _Traits=std::char_traits<char>,
_Allocator=std::allocator<char>]"
argument types are: (xml::XmlTranscode)
object type is: std::string
typeCodeString.assign(XmlTranscode(pointCodeElement.getAttribute(TYPE_CODE)));


And here is the function call for which the error is coming.

DOM_Element pointCodeElement;
typeCodeString.assign(static_cast<string>(XmlTranscode(pointCodeElement.getAttribute(TYPE_CODE))));

Does any one have any idea why this error is. It will be really hepfull if you guys check this out.

Thanks

Can you post a more complete example that still throws your error?

Hi,

Well XmlTranscode(pointCodeElement.getAttribute(TYPE_CODE)) was returning "XMLCh *" and was not able to assign it to string directly. os assigned to a char* and then assigned to string. it worked.

Thanks Naure, for giving attention to it.

Bye.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.