Я столкнулся со странной проблемой. Один и тот же код работает нормально по сравнению с 2008 и VS 2010 Отладка и отладка Unicode Версия, но не удалось скомпилировать в Release и Release Unicode .
Что может быть причиной этого.
Этот код генерирует ошибку
struct bitset_extractor
{
typedef std::forward_iterator_tag iterator_category;
typedef T value_type;
typedef T* pointer;
typedef T& reference;
typedef ptrdiff_t difference_type;
bitset_extractor(const boost::dynamic_bitset<T>& bs, T *buffer)
: bs_(bs), buffer_(buffer), current_(0)
{}
bitset_extractor(const bitset_extractor& it)
: bs_(it.bs_), buffer_(it.buffer_), current_(it.current_)
{}
T& operator*()
{
return buffer_[current_];
}
bitset_extractor& operator++()
{
++current_;
return *this;
}
private:
void operator=(T const&); // unimplemented
const boost::dynamic_bitset<T>& bs_;
T * const buffer_;
unsigned int current_;
};
1>C:\Program Files\Microsoft Visual Studio 10.0\VC\include\xutility(275): error C2679: binary '=' : no operator found which takes a right-hand operand of type 'bitstream::bitset_extractor<T>' (or there is no acceptable conversion)
1> with
1> [
1> T=uint8_t
1> ]
1> C:\vikram\Project\Seurat\src\app\logitech\LogiRTP\Library\Filters\plc\common\bitstream.h(195): could be 'void bitstream::bitset_extractor<T>::operator =(const T &)'
1> with
1> [
1> T=uint8_t
1> ]
1> while trying to match the argument list '(bitstream::bitset_extractor<T>, bitstream::bitset_extractor<T>)'
1> with
1> [
1> T=uint8_t
1> ]
1> C:\Program Files\Microsoft Visual Studio 10.0\VC\include\xutility(2176) : see reference to function template instantiation '_Iter &std::_Rechecked<_OutIt,_OutIt>(_Iter &,_UIter)' being compiled
1> with
1> [
1> _Iter=bitstream::bitset_extractor<uint8_t>,
1> _OutIt=bitstream::bitset_extractor<uint8_t>,
1> _UIter=bitstream::bitset_extractor<uint8_t>
1> ]
1> C:\vikram\Project\Seurat\3rdparty\boost\boost/dynamic_bitset/dynamic_bitset.hpp(1090) : see reference to function template instantiation '_OutIt std::copy<std::_Vector_const_iterator<_Myvec>,BlockOutputIterator>(_InIt,_InIt,_OutIt)' being compiled
1> with
1> [
1> _OutIt=bitstream::bitset_extractor<uint8_t>,
1> _Myvec=std::_Vector_val<unsigned char,std::allocator<uint8_t>>,
1> BlockOutputIterator=bitstream::bitset_extractor<uint8_t>,
1> _InIt=std::_Vector_const_iterator<std::_Vector_val<unsigned char,std::allocator<uint8_t>>>
1> ]
1> C:\vikram\Project\Seurat\src\app\logitech\LogiRTP\Library\Filters\plc\common\bitstream.h(210) : see reference to function template instantiation 'void boost::to_block_range<uint8_t,std::allocator<_Ty>,bitstream::bitset_extractor<T>>(const boost::dynamic_bitset<Block> &,BlockOutputIterator)' being compiled
1> with
1> [
1> _Ty=uint8_t,
1> T=uint8_t,
1> Block=uint8_t,
1> BlockOutputIterator=bitstream::bitset_extractor<uint8_t>
1> ]
1>C:\Program Files\Microsoft Visual Studio 10.0\VC\include\xutility(275): error C2582: 'operator =' function is unavailable in 'bitstream::bitset_extractor<T>'
1> with
1> [
1> T=uint8_t
1> ]