Boost logo

Ublas :

Subject: Re: [ublas] New uBLAS maintainer
From: Rutger ter Borg (rutger_at_[hidden])
Date: 2010-03-23 11:08:08

Rhys Ulerich wrote:

> Hi Rutger,
> I've used the MultiArray concept checks like this...
> using boost::detail::multi_array::MutableMultiArrayConcept;
> using suzerain::InterleavedState;
> where InterleavedState is my own templated MultiArray implementation.
> I think the only weirdness with the MultiArray concept checks is that
> they require a templated dimensionality (the second 3 in my example).
> Hope that helps,
> Rhys

To make my question a bit more concrete, the numeric_bindings library uses
so-called adaptors to access the right stuff in user-provided containers.
Its signature is

template< typename T, typename Id, typename Enable = void >
struct adaptor {};

the only way to make it work, it has to have available some partial
specialization of this template. One possibility is to use boost::enable_if:
If there is some kind of concept matching meta-func,

template< typename T, typename Id >
struct adaptor< T, Id, typename boost::enable_if< is_some_type<T> >::type >

the point is that I don't know how to rewrite (if at all possible) a concept
check into a meta-func is_concept_xxx<T>. If this is not possible, a
is_multi_array<T> function would have to be written in the multi_array
binding header, or something.