#pragma once namespace fc { /** * @brief Used to forward declare value types and break circular dependencies or use heap allocation * * A smart reference is heap allocated, move-aware, and is gauranteed to never be null (except after a move) */ template class smart_ref { public: template smart_ref( U&& u ); template smart_ref( U&& u, V&& v ); template smart_ref( U&& u, V&& v, X&&, Y&& ); smart_ref(); smart_ref( const smart_ref& f ); smart_ref( smart_ref&& f ); operator const T&()const; operator T&(); T& operator*(); const T& operator*()const; const T* operator->()const; T* operator->(); bool operator !()const; template T& operator = ( U&& u ); T& operator = ( smart_ref&& u ); T& operator = ( const smart_ref& u ); ~smart_ref(); private: T* impl; }; }