Hello to all, i have create a generic data manager which uses several data type format and different database but encountered an error to get the trait during object instantiation.
It cannot get the type traits defined.Code:template <typename T, template <typename U> class backEndFactoryType = ClsBackEndTypeTraits > class ClsSqlDataManager { public: ClsSqlDataManager(); ~ClsSqlDataManager(); int ReadData(const int&, const std::string&, soci::row&); int WriteData(const int&, const std::string&, soci::row&); //typedef backEndFactoryType<U>::backEndType backEndType; }; template <class T> class ClsBackEndTypeTraits { public: typedef T backEndType; }; //---------------------------------------------------------------- // Sqlite3 Back End Type Template Specialization template <> class ClsBackEndTypeTraits <soci::sqlite3_backend_factory> { public: typedef soci::sqlite3_backend_factory backEndType; }; Main.cpp ClsSqlDataManager<Json::Value, ClsBackEndTypeTraits > db;
Please help.
Thanks.




Reply With Quote