template class: how can initializate a typename?
see these code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
template <typename T>
class property
{
public:
T PropertyValue;
std::function<T(void)> getf;
std::function<void(T)> setf;
public:
property(const T &value)
{
getf=nullptr;
setf=nullptr;
PropertyValue=value;
}
property(const property &value) : PropertyValue(value.PropertyValue) , getf(value.getf)
{
}
property(std::function<T(void)> GetFunction=nullptr,std::function<void(T)> SetFunction=nullptr):setf(nullptr),getf(nullptr)
{
setf=SetFunction;
getf=GetFunction;
}
|
i must do a initializated list, but the PropertyValue it's a template type. so how can i initializate it to zero\NULL\nullptr or similar?
Topic archived. No new replies allowed.