You can subscribe to this list here.
2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(11) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
---|
From: Christoph S. <Chr...@un...> - 2010-06-01 10:04:30
|
> I was just having a look at these new problems and I notice that you > change in your code the union by struct. Is there any reason for it? I > was considering the same thing to be able to specialize the vec<half> > which can't be union. i changed to code to use a struct because unions haven't support for inheritance which i need to implement the CRTP (curiosly recurring template pattern). by using this pattern, it's much easier to enforce the glsl type conversion rules, check for correct dimensions and overload the operators. you can see that code in action in my expression template branch. i think the current approach could work, but is neither completely implemented, nor extensively tested. i will inform you when the code gets into a useable state. > This union with no constructor has always been a pain in all my > experiments to implement a good swizzle operator and I haven't found any > answer yet. I'm afraid this will remain a critical issue :/ this problem will be solved by c++0x. greetings, christoph |
From: Christophe R. <chr...@gm...> - 2010-06-01 00:06:35
|
Hi, I was just having a look at these new problems and I notice that you change in your code the union by struct. Is there any reason for it? I was considering the same thing to be able to specialize the vec<half> which can't be union. This union with no constructor has always been a pain in all my experiments to implement a good swizzle operator and I haven't found any answer yet. I'm afraid this will remain a critical issue :/ I still didn't had time to really tackle the subject but if everything goes well, it will have been the case within a week. Christophe On 28 May 2010 16:46, Christoph Schied <Chr...@un...> wrote: > Hi, > > I continued playing with the swizzle stuff and just encountered a major > problem which I wasn't aware of: > vec3 v1, v2; > v1.xy = v2.xy; > > This calls the default assignment constructor for attrib_alias_vec2 > which won't do anything as attrib_alias has no members. This cannot be > solved as C++ does not allow a member of a union to have a non-default > constructor. This also includes T & operator=(const T &t). The only > solution is to make the left and right side of the assignment different > types, but i don't know how one could create a template which has a > different type in each instantiation (and i don't think this would be a > nice thing). One solution is to make the different swizzle indizes of > different types, and as such make at least the following work: > vec3 v1, v2; > v1.rg = v2.xy; > The problem still is that one can't even declare the default-constructor > private, so one cannot create an error. > > Any ideas how this could be solved? > > greetings, > Christoph > > > > ------------------------------------------------------------------------------ > > _______________________________________________ > ogl-math-devel mailing list > ogl...@li... > https://lists.sourceforge.net/lists/listinfo/ogl-math-devel > |
From: Christoph S. <Chr...@un...> - 2010-05-28 15:46:19
|
Hi, I continued playing with the swizzle stuff and just encountered a major problem which I wasn't aware of: vec3 v1, v2; v1.xy = v2.xy; This calls the default assignment constructor for attrib_alias_vec2 which won't do anything as attrib_alias has no members. This cannot be solved as C++ does not allow a member of a union to have a non-default constructor. This also includes T & operator=(const T &t). The only solution is to make the left and right side of the assignment different types, but i don't know how one could create a template which has a different type in each instantiation (and i don't think this would be a nice thing). One solution is to make the different swizzle indizes of different types, and as such make at least the following work: vec3 v1, v2; v1.rg = v2.xy; The problem still is that one can't even declare the default-constructor private, so one cannot create an error. Any ideas how this could be solved? greetings, Christoph |
From: Christophe R. <g.t...@gm...> - 2010-05-22 08:21:13
|
From: Christophe R. <chr...@gm...> - 2010-05-22 08:14:10
|