From 351d7e3e2fdb2328d54819d1d467ad840479f8d9 Mon Sep 17 00:00:00 2001 From: mtarini Date: Fri, 2 Feb 2007 00:01:54 +0000 Subject: [PATCH] overloaded operator "[]" (once more) to make it possible to index the temp. structure with an iterator --- vcg/container/simple_temporary_data.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/vcg/container/simple_temporary_data.h b/vcg/container/simple_temporary_data.h index 5b629aff..6727e74e 100644 --- a/vcg/container/simple_temporary_data.h +++ b/vcg/container/simple_temporary_data.h @@ -24,6 +24,9 @@ History $Log: not supported by cvs2svn $ +Revision 1.4 2005/07/11 13:12:34 cignoni +small gcc-related compiling issues (typenames,ending cr, initialization order) + Revision 1.3 2004/12/11 15:37:47 ganovelli added one more [], now it is polymorphic, added typenames @@ -52,6 +55,7 @@ SimpleTempData(STL_CONT &_c):c(_c){}; // access to data ATTR_TYPE & operator[](const typename STL_CONT::value_type & v){return data[&v-&*c.begin()];} ATTR_TYPE & operator[](const typename STL_CONT::value_type * v){return data[v-&*c.begin()];} +ATTR_TYPE & operator[](const typename STL_CONT::iterator & cont){return data[&(*cont)-&*c.begin()];} ATTR_TYPE & operator[](const int & i){return data[i];} // start temporary attribute