]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Update FEValuesViews OutputType to use std::decay
authorJean-Paul Pelteret <jppelteret@gmail.com>
Thu, 24 Aug 2017 09:05:56 +0000 (11:05 +0200)
committerJean-Paul Pelteret <jppelteret@gmail.com>
Thu, 24 Aug 2017 09:23:28 +0000 (11:23 +0200)
include/deal.II/fe/fe_values.h

index 1afb4abcc32b050dfe7a748cf59598ccb244473f..3839ea98d07d23e8c498da7aa5ee3ce99ebd9ac0 100644 (file)
@@ -38,6 +38,8 @@
 
 #include <algorithm>
 #include <memory>
+#include <type_traits>
+
 
 // dummy include in order to have the
 // definition of PetscScalar available
@@ -176,31 +178,31 @@ namespace FEValuesViews
        * A typedef for the data type of the product of a @p Number and the
        * values of the view the Scalar class.
        */
-      typedef typename ProductType<typename std::remove_cv<Number>::type, typename Scalar<dim,spacedim>::value_type>::type value_type;
+      typedef typename ProductType<typename std::decay<Number>::type, typename Scalar<dim,spacedim>::value_type>::type value_type;
 
       /**
        * A typedef for the data type of the product of a @p Number and the
        * gradients of the view the Scalar class.
        */
-      typedef typename ProductType<typename std::remove_cv<Number>::type, typename Scalar<dim,spacedim>::gradient_type>::type gradient_type;
+      typedef typename ProductType<typename std::decay<Number>::type, typename Scalar<dim,spacedim>::gradient_type>::type gradient_type;
 
       /**
        * A typedef for the data type of the product of a @p Number and the
        * laplacians of the view the Scalar class.
        */
-      typedef typename ProductType<typename std::remove_cv<Number>::type, typename Scalar<dim,spacedim>::value_type>::type laplacian_type;
+      typedef typename ProductType<typename std::decay<Number>::type, typename Scalar<dim,spacedim>::value_type>::type laplacian_type;
 
       /**
        * A typedef for the data type of the product of a @p Number and the
        * hessians of the view the Scalar class.
        */
-      typedef typename ProductType<typename std::remove_cv<Number>::type, typename Scalar<dim,spacedim>::hessian_type>::type hessian_type;
+      typedef typename ProductType<typename std::decay<Number>::type, typename Scalar<dim,spacedim>::hessian_type>::type hessian_type;
 
       /**
        * A typedef for the data type of the product of a @p Number and the
        * third derivatives of the view the Scalar class.
        */
-      typedef typename ProductType<typename std::remove_cv<Number>::type, typename Scalar<dim,spacedim>::third_derivative_type>::type third_derivative_type;
+      typedef typename ProductType<typename std::decay<Number>::type, typename Scalar<dim,spacedim>::third_derivative_type>::type third_derivative_type;
     };
 
     /**
@@ -593,49 +595,49 @@ namespace FEValuesViews
        * A typedef for the data type of the product of a @p Number and the
        * values of the view the Vector class.
        */
-      typedef typename ProductType<typename std::remove_cv<Number>::type, typename Vector<dim,spacedim>::value_type>::type value_type;
+      typedef typename ProductType<typename std::decay<Number>::type, typename Vector<dim,spacedim>::value_type>::type value_type;
 
       /**
        * A typedef for the data type of the product of a @p Number and the
        * gradients of the view the Vector class.
        */
-      typedef typename ProductType<typename std::remove_cv<Number>::type, typename Vector<dim,spacedim>::gradient_type>::type gradient_type;
+      typedef typename ProductType<typename std::decay<Number>::type, typename Vector<dim,spacedim>::gradient_type>::type gradient_type;
 
       /**
        * A typedef for the data type of the product of a @p Number and the
        * symmetric gradients of the view the Vector class.
        */
-      typedef typename ProductType<typename std::remove_cv<Number>::type, typename Vector<dim,spacedim>::symmetric_gradient_type>::type symmetric_gradient_type;
+      typedef typename ProductType<typename std::decay<Number>::type, typename Vector<dim,spacedim>::symmetric_gradient_type>::type symmetric_gradient_type;
 
       /**
        * A typedef for the data type of the product of a @p Number and the
        * divergences of the view the Vector class.
        */
-      typedef typename ProductType<typename std::remove_cv<Number>::type, typename Vector<dim,spacedim>::divergence_type>::type divergence_type;
+      typedef typename ProductType<typename std::decay<Number>::type, typename Vector<dim,spacedim>::divergence_type>::type divergence_type;
 
       /**
        * A typedef for the data type of the product of a @p Number and the
        * laplacians of the view the Vector class.
        */
-      typedef typename ProductType<typename std::remove_cv<Number>::type, typename Vector<dim,spacedim>::value_type>::type laplacian_type;
+      typedef typename ProductType<typename std::decay<Number>::type, typename Vector<dim,spacedim>::value_type>::type laplacian_type;
 
       /**
        * A typedef for the data type of the product of a @p Number and the
        * curls of the view the Vector class.
        */
-      typedef typename ProductType<typename std::remove_cv<Number>::type, typename Vector<dim,spacedim>::curl_type>::type curl_type;
+      typedef typename ProductType<typename std::decay<Number>::type, typename Vector<dim,spacedim>::curl_type>::type curl_type;
 
       /**
        * A typedef for the data type of the product of a @p Number and the
        * hessians of the view the Vector class.
        */
-      typedef typename ProductType<typename std::remove_cv<Number>::type, typename Vector<dim,spacedim>::hessian_type>::type hessian_type;
+      typedef typename ProductType<typename std::decay<Number>::type, typename Vector<dim,spacedim>::hessian_type>::type hessian_type;
 
       /**
        * A typedef for the data type of the product of a @p Number and the
        * third derivatives of the view the Vector class.
        */
-      typedef typename ProductType<typename std::remove_cv<Number>::type, typename Vector<dim,spacedim>::third_derivative_type>::type third_derivative_type;
+      typedef typename ProductType<typename std::decay<Number>::type, typename Vector<dim,spacedim>::third_derivative_type>::type third_derivative_type;
     };
 
     /**
@@ -1155,13 +1157,13 @@ namespace FEValuesViews
        * A typedef for the data type of the product of a @p Number and the
        * values of the view the SymmetricTensor class.
        */
-      typedef typename ProductType<typename std::remove_cv<Number>::type, typename SymmetricTensor<2,dim,spacedim>::value_type>::type value_type;
+      typedef typename ProductType<typename std::decay<Number>::type, typename SymmetricTensor<2,dim,spacedim>::value_type>::type value_type;
 
       /**
        * A typedef for the data type of the product of a @p Number and the
        * divergences of the view the SymmetricTensor class.
        */
-      typedef typename ProductType<typename std::remove_cv<Number>::type, typename SymmetricTensor<2,dim,spacedim>::divergence_type>::type divergence_type;
+      typedef typename ProductType<typename std::decay<Number>::type, typename SymmetricTensor<2,dim,spacedim>::divergence_type>::type divergence_type;
     };
 
     /**
@@ -1411,13 +1413,13 @@ namespace FEValuesViews
        * A typedef for the data type of the product of a @p Number and the
        * values of the view the Tensor class.
        */
-      typedef typename ProductType<typename std::remove_cv<Number>::type, typename Tensor<2,dim,spacedim>::value_type>::type value_type;
+      typedef typename ProductType<typename std::decay<Number>::type, typename Tensor<2,dim,spacedim>::value_type>::type value_type;
 
       /**
        * A typedef for the data type of the product of a @p Number and the
        * divergences of the view the Tensor class.
        */
-      typedef typename ProductType<typename std::remove_cv<Number>::type, typename Tensor<2,dim,spacedim>::divergence_type>::type divergence_type;
+      typedef typename ProductType<typename std::decay<Number>::type, typename Tensor<2,dim,spacedim>::divergence_type>::type divergence_type;
     };
 
     /**

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.