#ifndef NALL_PROPERTY_HPP #define NALL_PROPERTY_HPP namespace nall { template struct property { template struct readonly { const T* operator->() const { return &value; } const T& operator()() const { return value; } operator const T&() const { return value; } private: T* operator->() { return &value; } operator T&() { return value; } const T& operator=(const T& value_) { return value = value_; } T value; friend C; }; template struct writeonly { void operator=(const T& value_) { value = value_; } private: const T* operator->() const { return &value; } const T& operator()() const { return value; } operator const T&() const { return value; } T* operator->() { return &value; } operator T&() { return value; } T value; friend C; }; template struct readwrite { const T* operator->() const { return &value; } const T& operator()() const { return value; } operator const T&() const { return value; } T* operator->() { return &value; } operator T&() { return value; } const T& operator=(const T& value_) { return value = value_; } T value; }; }; } #endif