Status: New
Owner: [email protected]
Labels: Type-Defect Priority-Medium
New issue 194 by vdolya: Failed to compile protobuf::test with Visual
Studio 2010: RepeatedFieldBackInsertIterator should be Assignable and Copy
Constructible
http://code.google.com/p/protobuf/issues/detail?id=194
What steps will reproduce the problem?
1. Try to compile 'Release' configuration of protobuf with Visual Studio
2010
2. During compilation of protobuf::tests getting:
xutility(275): error C2679: binary '=' : no operator found which takes a
right-hand operand of type
'google::protobuf::internal::RepeatedFieldBackInsertIterator<T>' (or there
is no acceptable conversion)
[skipped]
src\google\protobuf\repeated_field_unittest.cc(867) : see reference to
function template instantiation
What is the expected output? What do you see instead?
repeated_field_unittest.cc is expected to compile.
What version of the product are you using? On what operating system?
protobuf 2.3.0, Visual Studio 2010, Windows7
Please provide any additional information below.
It is expected from iterator to be assignable and copy constructable.
RepeatedFieldBackInsertIterator does not provide explicit implementation of
assignment operator, rather relying on compiler to generate default one.
But internal::RepeatedFieldBackInsertIterator class contains const member
attribute 'RepeatedField<T>* const field_'. In this case compiler is unable
to generate default copy assignment operator for the class, which might be
needed for several STL functions (std::copy in this case).
Should one provide explicit implementation for copy constructor/assignment
operator or this type of iterators are noncopyable by design?
--
You received this message because you are subscribed to the Google Groups "Protocol
Buffers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/protobuf?hl=en.