struct _HCFS
{
DWORD HCFS;
struct _HCFS operator=( int val);
};

struct _HCFS hcfs;
hcfs = 1;

this is OK,
but I define
volotile struct _HCFS hcfs;
hcfs =1;

there is alway a compilation error, saying "no overloading function found
for left operator struct _HCFS.

any suggestions?
thanks
pat

Re: overloading "=" operator, with volatile by Carl

Carl
Fri Aug 15 20:35:34 CDT 2003

Patrick Zou wrote:
> struct _HCFS

You shouldn't use names that start with underscore - they're reserved for
the implementation.

> {
> DWORD HCFS;
> struct _HCFS operator=( int val);

Operator = should return _HCFS&.

For a voliatile verion:

volatile _HCFS& operator=(int val) voliatle;

> };
>
> struct _HCFS hcfs;
> hcfs = 1;
>
> this is OK,
> but I define
> volotile struct _HCFS hcfs;
> hcfs =1;
>
> there is alway a compilation error, saying "no overloading function
> found for left operator struct _HCFS.
>
> any suggestions?
> thanks
> pat

-cd