15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


Map of Lists (Results)

Manolis Chr.Papadopoulos -- papadop@metal.ntua.gr
Friday, March 28, 1997

Hi,

First I should thank :

Hord Mark [MHORD@cerner.com]=20
David Ellis [dellis@workflowint.com]
Jason Healy" [jason@hkjcs.oz.au]
Olivier PLANCHON [Olivier.Planchon@orstom.sn]
Michael S. Scherotter [mss@tartus.com]

For answering my question.=20

It was my mistake that I did not mention that
typedef CList ThermoDataList;
followed by=20
CMap componentsData;
Was an obvious answer I already had tried. I sincerely apologise about =
that.=20

Anyway, the result was that VC produced the following error:
C:\MSDEV\MFC\include\afxtempl.h(1451) : error C2558: 'CList' : no copy constructor available.

The question was, and still is, whether I could get around this problem =
using any way other than the also obvious way of creating a new class =
out of Clist and defining its "=3D operator" or copy constructor.


Best regards,

Manolis Papadopoulos



Mike Blaszczak -- mikeblas@nwlink.com
Sunday, March 30, 1997

At 16:28 3/28/97 +0200, Manolis Papadopoulos wrote:

>Anyway, the result was that VC produced the following error:
>C:\MSDEV\MFC\include\afxtempl.h(1451) : error C2558: 'CListCThermoData,class CThermoData &>' : no copy constructor available.

>The question was, and still is, whether I could get around this problem =
>using any way other than the also obvious way of creating a new class =
>out of Clist and defining its "=3D operator" or copy constructor.

Why isn't the obvious answer good enough? You have to make your
own class derived from CList, and supply your own copy constructor
and assignment operator.

MFC doesn't supply one because the subtleties of the copy constructor
and assignment operator are often an unwelcome surprise to less
experienced developers. The code to derive your own class and implement
the operators you want should total less than a couple of dozen
lines. Once you've implemented the code, you should keep an eye on
how you use the assignment and copy constructors so that you don't
unsuspectingly cause performance problems.




.B ekiM
http://www.nwlink.com/~mikeblas/
These words are my own. I do not speak on behalf of Microsoft.
       One is too many and a million is not enough.




Become an MFC-L member | Вернуться в корень Архива |