473,545 Members | 2,113 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem Blocking operator=

I wrote:

class Parent
{
...
private:
virtual Parent& operator=(const Parent& parent);
};

class Child : public Parent
{
...
private:
virtual Child& operator=(const Child& parent);
};

In neither case was the operator=() defined.

With gcc 3.2, this failed to link, with undefined references
for both operator=(), notwithstanding that it was used nowhere
in my code.

The problem was corrected by removing both "virtual".
Is this expected, or is it a problem with the compiler?

Can anyone cite chapter & verse?

Thanks,
Mike.
Jul 22 '05 #1
2 1466
"Mike - EMAIL IGNORED" <m_************ *@yahoo.com> wrote...
I wrote:

class Parent
{
...
private:
virtual Parent& operator=(const Parent& parent);
};

class Child : public Parent
{
...
private:
virtual Child& operator=(const Child& parent);
};

In neither case was the operator=() defined.

With gcc 3.2, this failed to link, with undefined references
for both operator=(), notwithstanding that it was used nowhere
in my code.

The problem was corrected by removing both "virtual".
Is this expected, or is it a problem with the compiler?

Can anyone cite chapter & verse?


10.3/8: A virtual function declared in a class shall be defined,
or declared pure (10.4) in that class, or both; [...]

Victor
Jul 22 '05 #2
"Mike - EMAIL IGNORED" <m_************ *@yahoo.com> wrote in message
news:3F******** *******@yahoo.c om...
I wrote:

class Parent
{
...
private:
virtual Parent& operator=(const Parent& parent);
};

class Child : public Parent
{
...
private:
virtual Child& operator=(const Child& parent);
};

In neither case was the operator=() defined.

With gcc 3.2, this failed to link, with undefined references
for both operator=(), notwithstanding that it was used nowhere
in my code.
I think that's normal for virtual functions. By definition, the call of a
virtual function is decided at run-time, so I suppose the easiest
implementation is to make sure they are there, just in case.
The problem was corrected by removing both "virtual".
Is this expected, or is it a problem with the compiler?


'virtual' is inappropriate anyway because the argument type is different in
each case. Typically, assignment operators are not virtual.

DW

Jul 22 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
3128
by: Matt Chaplain | last post by:
Hi there. I'm writing a program that uses the Telnet protocol over TCP/IP sockets. Of course, that has no bearing here, so I'll rephrase that in Standard C++ :) In essense, I'm trying to manipulate a data stream by using a custom streambuf, so that I can access this as "just another iostream". Alas, this data stream has a couple of...
24
4642
by: neo | last post by:
Hi, I have a problem to set a JDBC connection as READ UNCOMMITED. setTransactionIsolation(Connection.TRANSACTION_READ_UNCOMMITTED) This is causing lots of blocking on tables and update or insert doesn't work properly. Does anyone have any idea what I'm missing here?
1
1493
by: Hal | last post by:
SQL2K, sp3 Active Server Pages front-end I am having a blocking problem with a spid executing a stored procedure that does no updates. When I look at the locks the blocking spid has, some of them have lock mode "IS". Looking in BOL, I see "S" is shared, but I don't see "IS". Can anyone tell me what lock mode "IS" is? And how could a...
5
5447
by: Ritesh | last post by:
Hi All, According to my observation using SP_WHO2 in my database, some INSERT statements are getting blocked by SELECT statements. Though the blocking SELECT statement is having ReadPast hint, i think, it will only read past locked resources but will not guarantee the select statement itself not blocking other statements(in my case...
7
2847
by: David Sworder | last post by:
Hi, I'm developing an application that will support several thousand simultaneous connections on the server-side. I'm trying to maximize throughput. The client (WinForms) and server communicate via a socket connection (no remoting, no ASP.NET). The client sends a message to the server that contains some instructions and the server responds...
3
2471
by: Matthew King | last post by:
Hi all I've written a asynchronous socket client class, but i've found that in order to consume it I have to use events, and cannot simply for example SocketClient client = new SocketClient(110, "some.server.com") client.Connect() client.SendData("Hello World") Instead I have to wait for the async method to raise a Connected event, and...
0
1289
by: alnsaisrinivas | last post by:
Hi I've a problem with I/O blocking on my serial port at this particular scenario... 1.I've developed a driver to communicate with some device using Serial Comm (overlapped I/O). 2.I'm able to send and receive messages perfectly. 3.As part of integration few more drivers also exist inorder to communicate with different devices. 4.I'm...
1
20570
by: Ryan Liu | last post by:
Hi, I have a 100 clients/ one server application, use ugly one thread pre client approach. And both side user sync I/O. I frequently see the error on server side(client side code is same, but I don't see the error): "System.IO.IOException: Unable to read data from the transport connection:A blocking operation was interrupted by a call...
4
1670
by: Neil | last post by:
Having trouble with inserting a record into a table. It's a list of names. But, for some reason, it won't take a particular name. When a user tries to enter a name into the table, the system hangs (users are using Access 2000 via ODBC linked table). I went into QA (SQL 7) and tried an Insert Into statement, but I got the same result from...
0
7468
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7401
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7808
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7423
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7757
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5972
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5329
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3450
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
704
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.