https://svn.lrde.epita.fr/svn/oln/trunk/milena/sandbox
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Write a solution for a common mistake.
* bugs/piter_slice.cc: Copy to...
* bugs/piter_slice.solved.cc: ...this new file.
Fix bug.
piter_slice.solved.cc | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
Index: bugs/piter_slice.solved.cc
--- bugs/piter_slice.solved.cc (revision 3588)
+++ bugs/piter_slice.solved.cc (working copy)
@@ -19,12 +19,17 @@
using namespace mln;
using value::int_u12;
- image3d<int_u12> ima(150, 256, 256);
+ typedef image2d<int_u12> I;
+
+ image3d<int_u12> ima(15, 25, 25);
image2d<util::array<int_u12> > ima_arr(ima.nrows(), ima.ncols());
- mln_piter_(image2d<int_u12>) p(slice(ima, 0).domain());
+
+ box2d b = slice(ima, 0).domain();
+ mln_piter_(I) p(b); // b is not a temporary object, so that's ok
+
for (int i = 0; i < ima.nslices(); ++i)
{
- image2d<int_u12> tmp_slice = duplicate(slice(ima, i));
+ I tmp_slice = duplicate(slice(ima, i));
for_all(p)
{
ima_arr(p).append(tmp_slice(p));
Property changes on: bugs/piter_slice.solved.cc
___________________________________________________________________
Added: svn:mergeinfo