// $Id$
// Version: $Name$
//
-// Copyright (C) 2003, 2004, 2005, 2006 by the deal.II authors
+// Copyright (C) 2003, 2004, 2005, 2006, 2008 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
}
+
+/**
+ * A type that can be used to determine whether two types are equal.
+ * It allows to write code like
+ * @code
+ * template <typename T>
+ * void Vector<T>::some_operation () {
+ * if (types_are_equal<T,double>::value == true)
+ * call_some_blas_function_for_doubles;
+ * else
+ * do_it_by_hand;
+ * }
+ * @endcode
+ *
+ * This construct is made possible through the existence of a partial
+ * specialization of the class for template arguments that are equal.
+ */
+template <typename T, typename U>
+struct types_are_equal
+{
+ static const bool value = false;
+};
+
+
+/**
+ * Partial specialization of the general template for the case that
+ * both template arguments are equal. See the documentation of the
+ * general template for more information.
+ */
+template <typename T>
+struct types_are_equal<T,T>
+{
+ static const bool value = true;
+};
+
+
+
// --------------- inline functions -----------------
<h3>base</h3>
<ol>
+ <li>
+ <p>
+ New: The new class types_are_equal allows to write some templates more
+ efficient by allowing to figure out whether certain template types are,
+ for example, equal to double or float (in which case we can use
+ BLAS functions, or could do something else special).
+ <br>
+ (WB 2008/10/31)
+ </p>
+
<li>
<p>
New: The Utilities::reverse_permutation and Utilities::invert_permutation