Thread: tuple usage

  1. #1
    Registered User
    Join Date
    Jan 2007
    Posts
    330

    tuple usage

    As you may know, the tr1 library includes tuples which is a generalized struct.
    But I'm wondering about the use of these tuples.

    Why do

    Code:
    int x = get<0>(mytuple) ;
    instead of

    Code:
    int x = mystruct.Firstmember;

  2. #2
    The larch
    Join Date
    May 2006
    Posts
    3,573
    I suppose that since the number of members is arbitrary, how would you propose giving English names to fields?
    I might be wrong.

    Thank you, anon. You sure know how to recognize different types of trees from quite a long way away.
    Quoted more than 1000 times (I hope).

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Reduce CPU usage
    By patrick22 in forum Windows Programming
    Replies: 9
    Last Post: 07-10-2009, 02:13 PM
  2. Net cpu usage of pthreads?!
    By mynickmynick in forum C++ Programming
    Replies: 15
    Last Post: 09-26-2008, 07:59 AM
  3. Memory usage and memory leaks
    By vsanandan in forum C Programming
    Replies: 1
    Last Post: 05-03-2008, 05:45 AM
  4. Calculating CPU Usage
    By vitaliy in forum Linux Programming
    Replies: 3
    Last Post: 08-21-2005, 09:38 AM
  5. Win2K Limiting CPU Usage?
    By drdroid in forum Tech Board
    Replies: 4
    Last Post: 03-31-2004, 02:08 PM