bug-commoncpp
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re[2]: More compiler errors: class NetworkDeviceInfo has no operator=


From: Andrey Kulikov
Subject: Re[2]: More compiler errors: class NetworkDeviceInfo has no operator=
Date: Wed, 24 Dec 2003 10:42:48 +0300

DS> This one I have not determined which approach would be better to do yet.  
But
DS> if you would like to submit a quick patch, I will look at that...

Function enumNetworkDevices() not compiled just because class
NetworkDeviceInfo contains member variable of class ost::String.

Solution:
Declare ost::String's operator= as

/**
* Assign our string from another string.
*/
inline void operator=(const String& str)
        {set(str);};

Now it declared without a 'const' as
inline void operator =(String& str)


DS> On Friday 19 December 2003 09:17 am, Tobias Erbsland wrote:
>> Hello
>>
>> A compiler error by MS Visual C++ .NET (7.0):
>>
>> network.cpp
>>          with
>>          [
>>              _Ty=ost::NetworkDeviceInfo
>>          ]
>>          d:\commoncpp2\src\network.cpp(84) : see reference to class
>> template instantiation 'std::vector<_Ty>' being compiled
>>          with
>>          [
>>              _Ty=ost::NetworkDeviceInfo
>>          ]
>>
>> because the class NetworkDeviceInfo has a copy constructor, but no
>> overloaded assign operator.
>>
>> Solution: overload the assign operator, or remove all assignments to the
>> std::vector<NetworkDeviceInfo> ...



-- 
Best regards,
 Andrey                            mailto:address@hidden





reply via email to

[Prev in Thread] Current Thread [Next in Thread]