Re: How to eliminate assignment operator generation warning

Tech-Archive recommends: Fix windows errors by optimizing your registry



>I'm using Microsoft Development Environment 2002 Version 7.0.9466 on
>Windows XP Professional Service Pack 2. If I compile the following
>code at maximum warning level:
>...
>I get the following warning:
>... warning C4512: 'SetValue' : assignment operator could not be
>generated
> ... see declaration of 'SetValue'

FWIW, the Comeau online compiler agrees with VC++ - it reports a more
useful message:

"ComeauTest.c", line 3: error: implicitly generated assignment
operator cannot copy:
reference member "SetValue::m_value"

>What is causing the warning and how can I eliminate it?

Add an assignment operator to the class.

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq
.



Relevant Pages

  • Re: C++ .. Lint warning
    ... > Getting warning in lint for this code. ... > trace(false), ... assignment operator and copy c'tor. ...
    (comp.lang.cpp)
  • Re: "Static" (VB6) equalivent in C++?
    ... Anna Smidt wrote: ... Right here, you have used the assignment operator, when you wanted ... Turn up your warning ...
    (microsoft.public.dotnet.languages.vc)
  • Top kernel oopses/warnings for the week of Friday June 6th, 2008
    ... (Reports prior to 2.6.23 have been omitted in collecting the top 10) ... Seen in untainted kernels ... Reported 298 times (938 total reports) ... This warning was last seen in version 2.6.26-rc4-git2, ...
    (Linux-Kernel)
  • Oops/Warning report of the week of July 4th 2008
    ... compared to 3794 reports in the previous week. ... driver is calling flush_workqueuewith a NULL parameter in some cases. ... Reported 264 times (2002 total reports) ... This warning was last seen in version 2.6.26-rc8-git2, ...
    (Linux-Kernel)
  • Oops report for the week preceding June 16th, 2008
    ... compared to 3390 reports in the previous week. ... Reported 276 times (1290 total reports) ... This warning was last seen in version 2.6.26-rc5-git7, ... Only seen with tainted kernels ...
    (Linux-Kernel)