class Data{
public:
std::string str;
double var;
template <typename UserType>
UserType operator()() const { return (UserType)var;}
template <typename UserType>
void operator()(UserType& utype) { var = (UserType)utype; }
};
int main()
{
Data d;
d.var = 5.5;
cout << d.operator()<int>();
return 0;
}