Hi,
I installed Boost 1.58.0 today, having been using 1.57.0 previously, and noticed that a part of my code that uses boost::factory doesn’t compile anymore. Here’s briefly what I’m doing, followed by the error message I’m
getting:
typedef
boost::function<Apollo::ReportGenerator*(Apollo::ApolloBaseModel*)>
reportFactory;
struct
reportListing {
std::string
displayName;
reportFactory
factory;
reportListing(std::string
name,
reportFactory
f) : displayName(name),
factory(f) { }
};
std::vector<reportListing>
reportFactories;
reportFactories.push_back(reportListing("Scenario
Analyzer", boost::factory<Apollo::ScenarioAnalyzer*>()));
// Apollo::ReportGenerator being the base class from which
Apollo::ScenarioAnalyzer is derived
...
The constructor for ScenarioAnalyzer is:
ScenarioAnalyzer(Apollo::ApolloBaseModel*
model)
This fails to compile with the following error (on Windows 7 using Visual C++ 12):
error C2664: 'Apollo::ScenarioAnalyzer *boost::factory<Pointer,void,factory_alloc_for_pointee_and_deleter>::operator ()(void) const' : cannot convert argument 1 from 'Apollo::ApolloBaseModel *' to 'Apollo::ApolloBaseModel
*&'
I’m just wondering if that is caused by an intentional change or not, because according to the change log to boost::factory no significant changes with implications to backward compatibility have been made.
Also, I’m not sure I know how to get rid of this error.
Thanks for the help!
/Fadi
Fadi Bitar Telephone direct
+46 (0)8 695 64 05 |
Sweco Energuide AB |
|
Please consider the environment before printing this e-mail.