home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / cplus / 12667 < prev    next >
Encoding:
Text File  |  1992-08-20  |  1.5 KB  |  45 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!charon.amdahl.com!pacbell.com!mips!mips!munnari.oz.au!cs.mu.OZ.AU!munta.cs.mu.OZ.AU!fjh
  3. From: fjh@munta.cs.mu.OZ.AU (Fergus James HENDERSON)
  4. Subject: Re: Proposal: auto T&
  5. Message-ID: <9223406.29682@mulga.cs.mu.OZ.AU>
  6. Sender: news@cs.mu.OZ.AU
  7. Organization: Computer Science, University of Melbourne, Australia
  8. References: <1992Aug19.234913.622@tfs.com> <1992Aug20.171342.3589@sunb10.cs.uiuc.edu>
  9. Date: Thu, 20 Aug 1992 20:41:25 GMT
  10. Lines: 33
  11.  
  12. pjl@sparc10.cs.uiuc.edu (Paul Lucas) writes:
  13.  
  14. >In <1992Aug19.234913.622@tfs.com> eric@tfs.com (Eric Smith) writes:
  15. >
  16. >>Much recent discussion about destruction of temporaries suggests a
  17. >>better way to solve the whole problem, and to allow returning references
  18. >>to temporaries from functions.
  19. >
  20. >>auto String& stringfunction(const String& input)
  21. >>{
  22. >>   // Calculate/create a new temporary or named automatic String
  23. >>   // and return a reference to it.
  24. >>}
  25. >
  26. >>The "auto" in the function return value type tells the compiler to allocate
  27. >>the space for that automatic in the stack frame of the caller, instead of
  28. >>the stack frame of the called function.
  29. >
  30. >*****>    It's not reentrant.
  31. >
  32. >    String a, b, c;            // also assume + has been overloaded
  33. >    // ...
  34. >    a = stringfunction( b ) + stringfunction( c );
  35.  
  36. Huh?
  37.  
  38. What do you mean by "it's not reentrant"? Why not?
  39.  
  40. -- 
  41. Fergus Henderson             fjh@munta.cs.mu.OZ.AU      
  42. This .signature VIRUS is a self-referential statement that is true - but 
  43. you will only be able to consistently believe it if you copy it to your own
  44. .signature file!
  45.