2018-01-11 20:16:25 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "boost/noncopyable.hpp"
|
|
|
|
|
|
|
|
namespace chatterino {
|
2018-04-03 02:55:32 +02:00
|
|
|
|
2018-01-11 20:16:25 +01:00
|
|
|
template <typename T>
|
|
|
|
class Property final : boost::noncopyable
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
Property()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2018-07-06 18:10:21 +02:00
|
|
|
Property(const T &value)
|
|
|
|
: value_(value)
|
2018-01-11 20:16:25 +01:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
T &operator=(const T &f)
|
|
|
|
{
|
2018-07-06 18:10:21 +02:00
|
|
|
return value_ = f;
|
2018-01-11 20:16:25 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
operator T const &() const
|
|
|
|
{
|
2018-07-06 18:10:21 +02:00
|
|
|
return value_;
|
2018-01-11 20:16:25 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
protected:
|
2018-07-06 18:10:21 +02:00
|
|
|
T value_;
|
2018-01-11 20:16:25 +01:00
|
|
|
};
|
2018-04-03 02:55:32 +02:00
|
|
|
|
|
|
|
} // namespace chatterino
|