TooN 2.1
Classes | Static Public Member Functions
CheckSlice< Size, Start, Length > Struct Template Reference

Check if a slice is OK. This class is used to see if a slice is OK. It provides a callable function which checks the run-time slice information. If the compile time information is bad, then it will not compile at all. Otherwise, the sizes are checked at run-time. The check will be optimized away if the sizes are known statically. More...

#include <slice_error.hh>

List of all members.

Classes

struct  N
 choose a number statically or dynamically. More...

Static Public Member Functions

static void check ()
static void check (int size, int start, int length)

Detailed Description

template<int Size, int Start, int Length>
struct TooN::Internal::CheckSlice< Size, Start, Length >

Check if a slice is OK. This class is used to see if a slice is OK. It provides a callable function which checks the run-time slice information. If the compile time information is bad, then it will not compile at all. Otherwise, the sizes are checked at run-time. The check will be optimized away if the sizes are known statically.


Member Function Documentation

static void check ( ) [static]

Check the slice. This is full static checking, which is stricter than mixed chacking. For instance, none of the slice parameters. This should be used in addition to the other check function. are allowed to be -1 (Dynamic).

Referenced by CheckSlice< Size, Start, Length >::check().

static void check ( int  size,
int  start,
int  length 
) [static]

Check the slice. The policy is that static sized where present are used. However, for extra debugging one can test to see if the static and dynamic sizes are mismatched. any sense whatsoever.

Parameters:
sizeVector size
startStart position of the slice
lengthLength of the slice.

References CheckSlice< Size, Start, Length >::check(), and TooN::Dynamic.