Atomorun2008 Opensource

downs default_357-line at yahoo.de
Wed Aug 20 20:37:14 PDT 2008


JAnderson wrote:
>> struct Point2D  and struct Point3D can be merged into a single
>> templated code, that can work with N coordinates, reducing code
>> duplication...
> 
> They could be but normally Point2D and Point3D have pretty specific
> operations that don't scale well.
> 
> -Joel
> 

But since they also have lots of code in common, put them into a template and wrap the unique code into static ifs.

Look at dglut.vector for an example of templated coordinate structs.


More information about the Digitalmars-d-announce mailing list