Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!rutgers!sri-spam!ames!ucbcad!ucbvax!serge From: serge@ucbvax.UUCP Newsgroups: comp.lang.c,comp.lang.c++ Subject: ANSI C & C++ idea Message-ID: <17516@ucbvax.BERKELEY.EDU> Date: Tue, 24-Feb-87 20:31:27 EST Article-I.D.: ucbvax.17516 Posted: Tue Feb 24 20:31:27 1987 Date-Received: Fri, 27-Feb-87 04:22:26 EST Organization: University of California at Berkeley Lines: 56 Keywords: ANSI, C, C++, idea Xref: utgpu comp.lang.c:1148 comp.lang.c++:142 [] I would like to propose the following notation (valid only in function argument declarations/definitions) void f(return Type *t) to mean that f() will only write the value pointed to by t, and not read it. That is, void f(const Type *t) would mean that f() only reads *t, and does not write it, while void f(return Type *t) would mean that f() only writes *t, and does not read it, and void f(Type *t) would mean that f() both reads and writes *t, e.g. t is a value-result parameter. In addition, an argument declared as Type *t could be passed to a function expecting a parameter of type const Type *t or return Type *t or Type *t However, an argument declared as return Type *t could only be passed to a function expecting a parameter of type return Type *t and an argument declared as const Type *t could only be passed to a function expecting a parameter of type const Type *t Comments? Serge serge@ucbvax.berkeley.edu ...!ucbvax!serge