Boost logo

Boost Users :

Subject: Re: [Boost-users] Help with (possibly MPL) pattern for a viewer that may contain a copy of statically allocated data
From: Max (loadcom_at_[hidden])
Date: 2009-01-27 10:12:34


> template<int M, int N, class Storage = boost::mpl::identity<> > class
regular_grid
> {
> typedef boost::array< boost::array<double, M>, N > array_type;
> typedef typename boost::mpl::apply<Storage, array_type>::type
storage_type;
> storage_type axis_;
> // use axis
> };
>
> typedef boost::add_reference<boost::add_const<boost::mpl::_1> >
> reference_policy; typedef boost::mpl::identity<> copy_policy;
>
> regular_grid<2, 3, reference_policy> g;
>
> In Christ,
> Steven Watanabe
>

Elegant solution I never began to imagine.
Thank you, Steven. It's _generally_ useful.

B/Rgds
Max


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net