Overview
Features
Download
Documentation
Community
Add-Ons & Services

WebWidgets compile errors on Solaris

General discussion regarding the development of POCO for contributors.

WebWidgets compile errors on Solaris

Postby alex » 27 Mar 2009, 15:24

I have somewhat of a dilemma here: Sun CC balks at having constructors taking const std::string& and const type_info& when a string literal is passed.

For example:

Code: Select all
Page::Ptr ptr = new Page("test");


will fail with following error:
Code: Select all
"src/ExtJSTest.cpp", line 105: Error: Overloading ambiguity between "Poco::WebWidgets::Page::Page(const std::type_info&)" and "Poco::WebWidgets::Page::Page(const std::string &)".


The solution can be provided in two ways and neither pleases me entirely:

    1) add Page(const char*) constructor - not good if we are aiming to get rid of plain pointers in the interface (although only the letter of the law is violated, not the spirit - pointer is only temporary means to an end and std::string copy is made immediately at construction time)

    2) force users to do new Page(std::string("test")) - this is kindof pain and likely not to be done on compilers that do not require it, causing code to become non-portable

I am inclined to go with 1), but wanted to bounce the dilemma first. I'll do the coding and submit modifications.
alex
 
Posts: 1130
Joined: 11 Jul 2006, 16:27
Location: United_States

Return to Contributors

Who is online

Users browsing this forum: No registered users and 3 guests

cron