C++
  Home arrow C++ arrow Page 2 - Temporary Variables: Procrastination is th...
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
C++

Temporary Variables: Procrastination is the Thief of Time
By: J. Nakamura
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 3
    2005-09-19

    Table of Contents:
  • Temporary Variables: Procrastination is the Thief of Time
  • Temporary Object Terminology
  • More than just a call
  • To return or not to return an object
  • Visualizing the unseen object
  • Back to the closest Enemy

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Temporary Variables: Procrastination is the Thief of Time - Temporary Object Terminology


    (Page 2 of 6 )

    Temporary (adj).

     Lasting, used, serving, or enjoyed for a limited time.

    Maybe you have run into the terms rvalue and/or lvalue while reading about C++. These are the terms used by the C++ Standard to discriminate between named objects (lvalues) and unnamed objects (rvalues).

    According to the Wikipedia:

    An lvalue is an expression that designates (refers to) an object. A non-modifiable lvalue is addressable, but not assignable. A modifiable lvalue allows the designated object to be changed as well as examined. An rvalue is any expression that isn’t an lvalue, it refers to a data value that is stored at some address in memory.

    What this basically means is that an lvalue (named object) is created every time you declare a variable explicitly (e.g. int i=1; or MyObject obj;). We are going to take a closer look at rvalues. These are the unseen temporary objects that are needed to implement parts of the C++ language (such as operator overloading). You never get to see them because they are fully handled by the compiler.

    More C++ Articles
    More By J. Nakamura


     

    C++ ARTICLES

    - Paths and Files
    - Directories in C++
    - Focusing on C++ Files
    - Const Correctness in C++
    - Manipulating Streams and Files with C++
    - Streams and Files
    - Multiplying Large Numbers with Karatsuba`s A...
    - Large Numbers
    - Dijkstra`s Shunting Algorithm with STL and C...
    - Brief Introduction to the STL Containers
    - The Standard Template Library
    - Templates in C++
    - C++ Programmer Alerts
    - C++ Programming Tips
    - First Steps in (C) Programming, conclusion






    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
    Stay green...Green IT