39 #ifndef BLOCXX_REFERENCE_HPP_
40 #define BLOCXX_REFERENCE_HPP_
41 #include "blocxx/BLOCXX_config.h"
46 namespace BLOCXX_NAMESPACE
52 #if !defined(__GNUC__) || __GNUC__ > 2 // because of a gcc 2.95 ICE
84 #if !defined(__GNUC__) || __GNUC__ > 2 // causes gcc 2.95 to ICE
86 template <
class U>
friend class Reference;
130 typedef char type_must_be_complete[
sizeof(T)];
161 #ifdef BLOCXX_CHECK_NULL_REFERENCES
162 ReferenceHelpers::checkNull(
this);
163 ReferenceHelpers::checkNull(m_pObj);
172 #ifdef BLOCXX_CHECK_NULL_REFERENCES
173 ReferenceHelpers::checkNull(
this);
174 ReferenceHelpers::checkNull(m_pObj);
189 return (m_pObj == 0);
198 rval.
m_pObj =
dynamic_cast<U*
>(m_pObj);
215 template <
class T,
class U>
221 template <
class T,
class U>
227 #if __GNUC__ == 2 && __GNUC_MINOR__ <= 96
230 inline bool operator!=(
const Reference<T>& a,
const Reference<T>& b)
232 return a.getPtr() != b.getPtr();
236 template <
class T,
class U>
239 return a.
getPtr() < b.getPtr();
244 #endif // BLOCXX_REFERENCE_HPP_