#include <iostream>
#include <string>
using namespace std;
class ConfigTest
{
public:
ConfigTest()
{
std::cout<<"Config constructor...."<<std::endl;
}
template<typename T>
T value( std::string key, T fallback ) const {
std::string r = "feier";
return r;
}
template<typename T>
T getIfSet( std::string key, T output ) const {
if ( key == "haces" ) {
T cc = value<T>(key, output);
return cc;
}
return false;
}
};
void main()
{
/** the follow line is error! this is not class template,but function template in class*/
//Config<std::string> testConfig;
ConfigTest testConfig;
std::string in = "haces";
std::string outputStr = "qq";
std::string testBool = testConfig.getIfSet(in,outputStr);
std::cout<<testBool<<endl;
system("pause");
}