Quote the "Working Draft, Standard for Programming Language C++" on a point I wasn...
authordooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Fri, 2 Nov 2007 20:54:19 +0000 (20:54 +0000)
committerdooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Fri, 2 Nov 2007 20:54:19 +0000 (20:54 +0000)
git-svn-id: http://svn.voria.com/code@1106 1f10aa63-cdf2-0310-b900-c93c546f37ac

synfig-studio/trunk/src/synfigapp/blineconvert.cpp

index 45ab5fc..2b29594 100644 (file)
@@ -602,7 +602,22 @@ synfigapp::BLineConverter::operator () (std::list<synfig::BLinePoint> &out, cons
                                gaussian_blur_3(ftemp.begin(),ftemp.end(),false);
 
                        df.resize(size);
+
+                       // Wondering whether the modification of the df vector
+                       // using a char* pointer and pointer arithmetric was safe,
+                       // I looked it up...
+                       // 
+                       // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2369.pdf tells me:
+                       // 
+                       //      23.2.5  Class template vector [vector]
+                       // 
+                       //      [...] The elements of a vector are stored contiguously,
+                       //      meaning that if v is a vector<T,Allocator> where T is
+                       //      some type other than bool, then it obeys the identity
+                       //      &v[n] == &v[0] + n for all 0 <= n < v.size().
+                       // 
                        GetFirstDerivatives(ftemp,0,size,(char*)&df[0],sizeof(df[0]));
+
                        //GetSimpleDerivatives(ftemp,0,size,df,0,di);
                        //< don't have to worry about indexing stuff as it is all being taken care of right now
                        //preproceval += timer();