Re: [Algorithms] How to get 3dvector largest coordinate index?
Brought to you by:
vexxed72
From: liam m. <lia...@go...> - 2009-03-06 12:19:29
|
2009/3/6 Gino van den Bergen <gin...@gm...> > Yes, I know. Call me reckless but I just do not believe that > strict-aliasing on union fields will be exploited by a C++ compiler any > time soon. It will break too much existing code (not only mine). > > liam mail wrote: > > > > > > 2009/3/6 Gino van den Bergen <gin...@gm... > > <mailto:gin...@gm...>> > > > > The whole "union is > > considered harmful" debate seems to be a mostly religious one. > > > > It is really quite simple in that it is undefined behaviour to type > > cast using a union. Now if you want to heed this information it is up > > to you, just because something works on day X on compiler Y does not > > mean it will work on a different version of the compiler or on a > > different compiler altogether. > > ------------------------------------------------------------------------ > > > > > ------------------------------------------------------------------------------ > > Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, > CA > > -OSBC tackles the biggest issue in open source: Open Sourcing the > Enterprise > > -Strategies to boost innovation and cut costs with open source > participation > > -Receive a $600 discount off the registration fee with the source code: > SFAD > > http://p.sf.net/sfu/XcvMzF8H > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > GDAlgorithms-list mailing list > > GDA...@li... > > https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list > > Archives: > > > http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list > > > > ------------------------------------------------------------------------------ > Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, > CA > -OSBC tackles the biggest issue in open source: Open Sourcing the > Enterprise > -Strategies to boost innovation and cut costs with open source > participation > -Receive a $600 discount off the registration fee with the source code: > SFAD > http://p.sf.net/sfu/XcvMzF8H > _______________________________________________ > GDAlgorithms-list mailing list > GDA...@li... > https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list > I am sorry I do not understand why you think this is to do with aliasing? The standard guarantees that union fields occupy the same space yet that only one maybe active. 9.5 Unions [class.union] 1 In a union, at most one of the data members can be active at any time, that is, the value of at most one of the data members can be stored in a union at any time. [Note: one special guarantee is made in order to simplify the use of unions: If a POD-union contains several POD-structs that share a common initial sequence (9.2), and if an object of this POD-union type contains one of the POD-structs, it is permitted to inspect the common initial sequence of any of POD-struct members; see 9.2. ] |