Index: trunk/nv/common.hh
===================================================================
--- trunk/nv/common.hh	(revision 54)
+++ trunk/nv/common.hh	(revision 55)
@@ -151,6 +151,12 @@
 } // namespace nv
 
+template <typename OBJ, typename T> 
+inline size_t offset_of(T OBJ::*ptr)
+{
+	return ((size_t)&(((OBJ*)0)->*ptr));
+}
+
 template <typename T, typename U>
-T* down_cast(U* x)
+inline T* down_cast(U* x)
 {
 #if NV_DEBUG
Index: trunk/nv/types.hh
===================================================================
--- trunk/nv/types.hh	(revision 54)
+++ trunk/nv/types.hh	(revision 55)
@@ -194,4 +194,5 @@
 			, flags( 0 )
 			, offset( offsetof( TOBJECT, *field ) )
+			// NOTE: if offsetof behaves badly, check offset_of in common.hh
 		{
 			flags = 
