Boost logo

Ublas :

From: Michael Stevens (mail_at_[hidden])
Date: 2005-07-06 09:43:05


Dear All,

I've been stuck on this problem for a long time and wonder if anyone knows a
trick which will help out.

The problem arises in that the type of the template parameter is 'incomplete'
in the base class. So in the following base class:

template <class E>
struct expression {
        typedef E expression_type;
// typedef typename E::size_type size_type;
};

we are restricted in what we can do with E. In particular it is not possible
to extract types out of E. The commented out typedef will fail as E is
incomplete. Curiously it is possible to write member functions that
manipulate such types.

So the following is fine.

template <class E>
struct expression {
        typedef E expression_type;
        static void function1 ()
        {
                typename E::size_type a;
        }
};

What would be nice is to be able a similar function which can return 'a'. But
this seems impossible.

Anyone know of a trick?

Michael

-- 
___________________________________
Michael Stevens Systems Engineering
34128 Kassel, Germany
Phone/Fax: +49 561 5218038
Navigation Systems, Estimation  and
                 Bayesian Filtering
    http://bayesclasses.sf.net
___________________________________