|
Boost Users : |
From: Ewan Campbell (ewancampbell_at_[hidden])
Date: 2004-10-14 11:04:33
When resizing a multi-dimensional array I receive the warning:
d:\microsoft visual studio\vc98\include\xutility(100) : warning C4101:
'_Tmp' : unreferenced local variable
d:\boost\include\boost-1_31\boost\multi_array.hpp(246) : see
reference to function template instantiation 'void __cdecl
std::swap(class std::allocator<double> &,class std::allocator<double>
&)' being compiled
An unreference local variable is not exactly the end of the world, but
it is churned out every time a file is compiled that include this
function and I'd rather not disable this warning. I can find no mention
of anyone else having this problem for such a widely used function
(dynamically resizing arrays).
The specific line that appears to be causing the problem is:
swap(this->allocator_,new_array.allocator_);
in "multi_array.hpp"
I am resizing the array like so
header file:
typedef boost::multi_array<double, 2> array2d_type;
typedef array2d_type::index index;
Class CArrayConfiguration{
...
protected:
...
array2d_type m_pReceiveArray;
...
};
implementation file:
m_pReceiveArray.resize(boost::extents[M][5]); // where M = 10 -> 1000
and it is this line that prompts the warning.
I am using MSVC++ 6.0 on WinXP.
If I initalising the array to shape and then resize it there is no
problem, but I require it to be a class member variable.
Thanks in advance,
ec
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