Anonymous - 2002-04-04

...
The problem is easy to explain with 2 Files:
********************************************
// File_1 Begin
template<unsigned num>
class CMaps
{
private:
    static bool inicialized;
    unsigned**  OperationMap;
public:
//*fill the OpertionMap (very expensive in time)
//*constructors (allocate memory only
// if inicialized is false, only one time,
// the first;
//*destructors (deallocate memory only
// if OperationMap is not (void*)0 (for classes)
//*etc...
};
bool CMaps::inicialized=false;
//logicaly, the compiler rejects this construction
bool CMaps<num>::inicialized=false;
// num not declared (extern const unsigned num?
// but it don't functions)
// I can only initializing it in "main.cpp"?
// File_1 End
**************************************************
**************************************************
// File_2 Begin
template<unsigned number>
class CTypeOfNumber
{
private:
    static const CMaps<number>    OP;
    unsigned                value;
//the authentic content of this class template
public:
// The constructor would be initializer
// the static member OP?
// etc...
};
const CMaps<number> CTypeOfNumber<number>::OP(args);
//Through constructor
// Which is the way?
// File_2 End

This would be a library for Mathematics Types as Discrete Groups, Rings (Abelian or not), Galois Fields,Polinomials over the mentioned structures, Matrix over any Type of Ring,...

Actually, I was implemented this with a reference CMaps<number>& into CTypeOfNumber<number>, but that isn`t optimal. And I construct the CMap<number> in main().

I agree? all commentaries.
(My english idiom is very bad, I feeling it).

Thanks.

JULIAN CALDERON ALMENDROS
MALAGA/SPAIN
julian_calderon@eresmas.com