Boost logo

Boost :

Subject: Re: [boost] [non Boost] Template troubles.
From: Neil Groves (neil_at_[hidden])
Date: 2008-12-10 06:50:04


Robert,

On Wed, Dec 10, 2008 at 10:55 AM, Robert Jones <robertgbjones_at_[hidden]>wrote:

> On Wed, Dec 10, 2008 at 10:20 AM, Neil Groves <neil_at_[hidden]
> >wrote:
>
> >
> > Neither of these are exact matches... is this deliberate? Or did you
> mean:
> >
> > template<typename T, std::size_t sz>
> > void assign(T (&assignee)[sz][sz], const T(&value)[sz][sz])
> > {
> > }
> >
> > I wondered this, because this modification makes it compile on Visual C++
> > because it is an exact match.
> >
> >
> Hi Neil
>
> Ultimately the signature you suggest is what I want to call, however I was
> hoping to achieve this via recursive instantiation, largely because looping
> over one index in the implementation is easily achieved with a for_each
> loop and a bind() call, whereas looping over two indices is rather
> cumbersome.
> In practise there's also some other house keeping, which makes the
> recursive instantiation approach quite attractive.
>

I now understand the motivation, however I think you are out of luck unless
you disambiguate the calls. Perhaps you can use SFINAE, or dare I suggest
using boost::array<boost::array< constructions instead?

>
> The exact match case you present is spot on, and in fact was my first cut
> at this functionality. What I'm unclear on is why the single dimensional
> case
> is not also an exact match with appropriate inferring of T.
>
> Thanks for your thoughts.
>
> - Rob.

Neil

>
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost
>


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk