|
Boost Users : |
Subject: Re: [Boost-users] multi_array_ref (lack of) default constructor
From: gtsml owevwr (gtsml.owevwr_at_[hidden])
Date: 2009-05-31 09:11:54
> I don't know, but if it did what would you have it do? Surely it lacks
> one for the same reason that references must be initialised?
Yes, that's absolutely right, I just realized that multi_array_ref
exactly mimic the C++ ref (probably obvious).
I originally thought that multi_array_ref will solve the problem I had
with multi_array ownership: the memory chunk I need to work with is
already owned by another class. But multi_array_ref is too restrictive
for my purpose. As I said, I need to pass a vector of those and that's
just not possible.
I'm not explaining it too well but the bottom line is that from my
perspective multi_array_ref is:
- good because it doesn't own the data
- bad because it act as a ref:
- no default constructor
- operator= is a deep copy
Ideally, I'm looking for what most people call "a view". Probably
playing with words here, but definitely, multi_array_ref is not what I
am looking for.
Thanks,
Frank
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