Example #1
0
/**
 * \param i for i=0, returns the first component of the vector (x), for
 *        i=1, returns the second component of the vector (y), for i=2,
 *        returns the third component of the vector (z), for i=3, returns
 *        the scalar (w).
 */
const REAL& QUAT::operator[](unsigned i) const
{
  switch (i)
  {
    case 0: return x;
    case 1: return y;
    case 2: return z;
    case 3: return w;
    default:
      throw InvalidIndexException();
  }

  // make compiler happy
  return x;
}
Example #2
0
Variable * Variable_bool::at(const str8 &index) const {
	throw InvalidIndexException();
	return 0;
}
Example #3
0
Variable * Variable_bool::at(size_t index) const {
	if (index != 0) {
		throw InvalidIndexException();
	}
	return const_cast<Variable_bool *>(this);
}