Boost logo

Ublas :

Subject: Re: [ublas] [bindings][traits] Type decoration
From: Rutger ter Borg (rutger_at_[hidden])
Date: 2009-03-18 10:45:29


Rutger ter Borg wrote:

>
> Guys,
>
> I'm looking into realizing a trans(matrix_type) type decorator, but
> apparently this requires a bit more work before it will play nice with
> everything. The thing is that many algorithms including the type traits
> system have their arguments passed by reference.
>
> matrix a;
> some_func( a ); // OK, instance of A exists (LValue)
> some_func( trans(a) ); // not OK, no instance of trans(A) is available
> (RValue)
>

A way around this could be, e.g.,

template< Matrix >
solve( char trans_tag, Matrix &a ) {
}

template< Matrix >
solve( trans_impl<Matrix> const& a ) {
   solve( a.tag(), a.get() );
}

but I'm not sure if that's the most elegant.

Cheers,

Rutger