PDA

View Full Version : Templated datatype primitives in ClanLib 0.9



rombust
01-28-2009, 08:24 PM
I have templated:
CL_Sizex to give: CL_Size (int) ,CL_Sized (double), CL_Sizef (float)
CL_Rectx to give: CL_Rect (int) ,CL_Rectd (double), CL_Rectf (float)

At the moment, it is typedef’d as follows:

Typedef CL_Sizex<float> CL_Sizef

I was thinking of changing this to:
Class CL_Sizef : public(CL_Sizex<float>)
{
(use the using keyword to obtain the constructors from CL_Sizex<float>
}

This should allow you to do the following:

Class CL_Sizef; - to declare the size without including the header

Any thoughts?

rombust
01-29-2009, 08:08 AM
You cannot use the using declaration with constructors

Anyway, i have converted them back to classes (using a template as the base class)

rombust
01-29-2009, 11:29 AM
I have finished the review of the ClanLib math functions :)