const char* parameter passed in Catalog::Create does not match std::string
C++ Dependency Injection
Brought to you by:
daniele77
Originally created by: daniele....@gmail.com
Originally owned by: daniele....@gmail.com
Steps to reproduce the problem:
1. Car::Car( const std::string& color ) { ... }
2. catalog.Create( "ferrari_f430", "Car", "red" );
The Catalog::Create throws an exception because it cannot find a registered class with a constructor that takes a const char* parameter.
I'd like to have an automatic conversion from const char* to const std::string& (maybe using template partial specialization).
View and moderate all "tickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: d.ledent...@gmail.com
Are you sure, you need automatic conversion? It might decrease safety in case someone mixes types