| User Documentation | 
| RAVL, Recognition And Vision Library | 
| DEVELOP | HOME PAGE | CLASS LIST | CONTENTS | 
| Ravl - Core - Indexing - IndexC | 
| IndexC | |
| Index class for indexing 1D arrays: an integer class with modified rounding and other operations | |
| include | "Ravl/Index.hh" | 
| Created: | 2/1/1996 | 
| User Level: | Basic | 
| Library: | RavlCore | 
| Example: | exIndex.cc | 
| In Scope: | RavlN | 
int type, in an attempt to correct some of the perceived
 deficiencies of int:
 (unsigned int) 4 / (-2) = 0.
 int type, rounding is either towards zero (e.g. on conversion
 from floating point representations), or implementation-dependent (e.g.
 integer division operations).  Where negative numbers are
 involved, this behaviour is often not what is required, particularly for
 indexing purposes.  
 int, to
 provide more consistent behaviour for indexing purposes, and to improve
 portability of code. 
  The major differences between IndexC and int are: 
 
int type, the results would probably be -1 and -1 respectively. 
 int.  For
 a class, the type of the first operand of binary operator determines
 the class member function used.
 int, you can't use IndexC everywhere you would use an
 int.  In particular you can't use an IndexC object directly as
 an int function argument.  You need to use the V() member function to achieve this.  (We could have provided the implicit conversion, but it would then be very difficult sometimes to know which was actually being used.) | Maintainer:Radek Marik, Created: 2/1/1996, Documentation by CxxDoc: Tue Aug 13 09:59:02 2002 |