c++boost.gif (8819 bytes)
Main Page   File List   File Members  

adt.hpp File Reference


Defines

#define BOOST_PP_LIST_CONS(H, T)
 List constructor. More...

#define BOOST_PP_LIST_NIL
 List nil constructor. More...

#define BOOST_PP_LIST_IS_CONS(L)
 Expands to 1 if the list is not nil and 0 otherwise. More...

#define BOOST_PP_LIST_IS_NIL(L)
 Expands to 1 if the list is nil and 0 otherwise. More...

#define BOOST_PP_LIST_FIRST(L)
 Expands to the first element of the list. The list must not be nil. More...

#define BOOST_PP_LIST_REST(L)
 Expands to a list of all but the first element of the list. The list must not be nil. More...


Detailed Description

Click here to see the header.

This header defines the fundamental list operations.

NOTE: The internal representation of lists is hidden. Although there aren't compelling reasons to change the representation, you should avoid writing code that depends on the internal representation details.


Define Documentation

#define BOOST_PP_LIST_CONS H,
 
 

List constructor.

Lists are build using list constructors BOOST_PP_LIST_NIL and BOOST_PP_LIST_CONS(). For example,

  BOOST_PP_LIST_CONS(1,
  BOOST_PP_LIST_CONS(2,
  BOOST_PP_LIST_CONS(3,
  BOOST_PP_LIST_CONS(4,
  BOOST_PP_LIST_CONS(5,
  BOOST_PP_LIST_NIL)))))

Short lists can also be build from tuples:

  BOOST_PP_TUPLE_TO_LIST(5,(1,2,3,4,5))

Both of the above lists contain 5 elements: 1, 2, 3, 4 and 5.

#define BOOST_PP_LIST_FIRST  
 

Expands to the first element of the list. The list must not be nil.

For example,

  BOOST_PP_LIST_FIRST(BOOST_PP_TUPLE_TO_LIST(5,(1,2,3,4,5)))

expands to 1.

See BOOST_PP_LIST_REST().

#define BOOST_PP_LIST_IS_CONS  
 

Expands to 1 if the list is not nil and 0 otherwise.

See BOOST_PP_LIST_IS_NIL().

#define BOOST_PP_LIST_IS_NIL  
 

Expands to 1 if the list is nil and 0 otherwise.

See BOOST_PP_LIST_IS_CONS().

#define BOOST_PP_LIST_NIL
 

List nil constructor.

See BOOST_PP_LIST_CONS().

#define BOOST_PP_LIST_REST  
 

Expands to a list of all but the first element of the list. The list must not be nil.

For example,

  BOOST_PP_LIST_REST(BOOST_PP_TUPLE_TO_LIST(5,(1,2,3,4,5)))

expands to a list containing 2, 3, 4 and 5.

See BOOST_PP_LIST_FIRST().


© Copyright Housemarque Oy 2001

Permission to copy, use, modify, sell and distribute this document is granted provided this copyright notice appears in all copies. This document is provided "as is" without express or implied warranty, and with no claim as to its suitability for any purpose.

Generated: