TooN::IsField< C > Struct Template Reference

#include <TooN.h>

List of all members.

Static Public Attributes

static const int value = numeric_limits<C>::is_specialized
 Is C a field?

Detailed Description

template<class C>
struct TooN::IsField< C >

Is a number a field? ie, +, -, *, / defined. Specialize this to make TooN work properly with new types. The primary reason for this is to allow SFINAE to work properly. This is required if there are the following two functions:

              Vector<> * X  //Generic type X
              Vector<> * DiagonalMatrix<>

If one of the functions is a substitution failure, then it will be ignored, allowing the functions to coexist happily. However, not all types of failure are substitution failures. TooN's type deduction happens when determining the return type of the function. This is too early, so the wrong kind of error in the return type deduction causes an error, rather than a substitution failure. The IsField mechanism makes it the right kind of error, thereby allowing a substitution failuer to occur.

Definition at line 101 of file TooN.h.


Member Data Documentation

template<class C >
const int TooN::IsField< C >::value = numeric_limits<C>::is_specialized [static]

Is C a field?

Definition at line 103 of file TooN.h.


The documentation for this struct was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Friends Defines


libtoon
Author(s): Florian Weisshardt
autogenerated on Fri Jan 11 10:09:49 2013