#pragma once

template<typename T>
class Property
{
public:
	Property(const T &data): data{data}{}

	T operator()() { return data; }
	void operator()(const T& d) { data = d; }
	Property<T> operator=(const T& d) { data = d; }
	operator T() const { return data; } // to easily pass a property to a function which takes a var of type T for example: void func(float f) => func(property)

private:
	T data;
	void operator=(const Property<T>& p); // so this property can not be overwritten, since this might lead to a memory leak. Maybe this operator can be used to assign only the data (C#-like)?
};

template<typename T>
class ReadOnlyProperty
{
public:
	ReadOnlyProperty(const T &data): data{data}{}

	T operator()() { return data; }
	operator T() const { return data; } // to easily pass a property to a function which takes a var of type T for example: void func(float f) => func(property)

private:
	T data;
	void operator=(const ReadOnlyProperty<T>& p); // so this property can not be overwritten, since this might lead to a memory leak. Maybe this operator can be used to assign only the data (C#-like)?
};
