Boost logo

Ublas :

Subject: Re: [ublas] [bindings][traits] Type decoration
From: Karl Meerbergen (Karl.Meerbergen_at_[hidden])
Date: 2009-03-18 10:39:49


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)
>
> the type traits also use references to most underlying objects. Do you know
> of a clean way on how to bypass this?
>
> Thanks,
>
> Rutger
>

Rutger,

In glas, I use a meta function to decide whether an argument is passed
by value or by reference. This implies two versions of some_func to be
written. The choice is decided by boost::enable_if.

Best,

Karl

>
>
> _______________________________________________
> ublas mailing list
> ublas_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/ublas
>