🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c++
Article #1037

Re: What is int &volatile r; [Was: What is int &const r;]

#1037
From: Mike Banahan
Date: Mon, 22 Apr 1991 18:48
20 lines
1604 bytes
... what is "int & volatile .. " ...

A good question to ask! A volatile reference to (exactly what doesn't matter)
- if we were talking about C, and using a pointer, then it would mean that
the value of the pointer was subject to unpredictable external change
which cannot be discovered by simply reading the program; this is intended
to allow for interrupts and concurrency to be implemented.

Since a reference is not modifiable by the program (it's const), the utility
of having a volatile one is severely questionable, but undoubtedly capable
of implementation. One could imagine a globally-visible reference which
is somehow updated by an interrupt routine to refer to various different
objects at run-time. This makes me want to throw up, but that's what it
mean by analogy with pointer types. If one of my guys did that with a reference,
I daren't put in writing what I would want to do with him/her.

Mike Banahan
-- 
Mike Banahan, Founder Director, The Instruction Set Ltd.
mikeb@inset.co.uk
Technical Details
Message-ID: <1653@inset.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!sdd.hp.com!spool.mu.edu!snorkelwacker.mit.edu!bloom-beacon!eru!hagbard!sunic!mcsun!ukc!stc!inset!mikeb
References: <NGO.91Apr17224214@tammy.harvard.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!sdd.hp.com!spool.mu.edu!snorkelwacker.mit.edu!bloom-beacon!eru!hagbard!sunic!mcsun!ukc!stc!inset!mikeb
From: mikeb@inset.UUCP (Mike Banahan)
Newsgroups: comp.std.c++
Subject: Re: What is int &volatile r; [Was: What is int &const r;]
Message-ID: <1653@inset.UUCP>
Date: 22 Apr 91 18:48:14 GMT
Article-I.D.: inset.1653
References: <NGO.91Apr17224214@tammy.harvard.edu>
Reply-To: mikeb@inset.co.uk (Mike Banahan)
Distribution: comp
Organization: The Instruction Set Ltd., London, UK.
Lines: 20