From: David Wells Date: Fri, 8 Jul 2016 10:40:25 +0000 (-0400) Subject: Remove a 'using' template alias. X-Git-Tag: v8.5.0-rc1~902^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=acfd77e63b3d1fcd67c0af18149551a5c62e38c0;p=dealii.git Remove a 'using' template alias. This is a C++11 feature that is not compatible with some older compilers that we would like to support (e.g., GCC 4.6 on Ubuntu 12.04). --- diff --git a/include/deal.II/base/quadrature_point_data.h b/include/deal.II/base/quadrature_point_data.h index 6a51e7ae08..4b099374fb 100644 --- a/include/deal.II/base/quadrature_point_data.h +++ b/include/deal.II/base/quadrature_point_data.h @@ -60,11 +60,6 @@ template class CellDataStorage : public Subscriptor { public: - /** - * A typedef for a vector of shared pointers with arbitrary data type @p T . - */ - template using CellVector = std::vector >; - /** * Default constructor. */ @@ -156,7 +151,7 @@ private: /** * A map to store a vector of data on a cell. */ - std::map > map; + std::map>> map; }; @@ -520,7 +515,7 @@ void CellDataStorage::initialize(const CellIteratorTy map[cell] = std::vector >(n_q_points); // we need to initialise one-by-one as the std::vector<>(q, T()) // will end with a single same T object stored in each element of the vector: - typename std::map >::iterator it = map.find(cell); + auto it = map.find(cell); for (unsigned int q=0; q < n_q_points; q++) it->second[q] = std::make_shared(); } @@ -544,7 +539,7 @@ void CellDataStorage::initialize(const CellIteratorTy template bool CellDataStorage::erase(const CellIteratorType &cell) { - const typename std::map >::const_iterator it = map.find(cell); + const auto it = map.find(cell); for (unsigned int i = 0; i < it->second.size(); i++) { Assert(it->second[i].unique(), @@ -563,7 +558,7 @@ void CellDataStorage::clear() // Do not call // map.clear(); // as we want to be sure no one uses the stored objects. Loop manually: - typename std::map >::iterator it = map.begin(); + auto it = map.begin(); while (it != map.end()) { // loop over all objects and see if noone is using them @@ -581,20 +576,20 @@ void CellDataStorage::clear() template template -CellDataStorage::CellVector +std::vector > CellDataStorage::get_data(const CellIteratorType &cell) { static_assert(std::is_base_of::value, "User's T class should be derived from user's DataType class"); - typename std::map >::iterator it = map.find(cell); + auto it = map.find(cell); Assert(it != map.end(), ExcMessage("Could not find data for the cell")); // It would be nice to have a specialized version of this function for T==DataType. // However explicit (i.e full) specialization of a member template is only allowed // when the enclosing class is also explicitly (i.e fully) specialized. // Thus, stick with copying of shared pointers even when the T==DataType: - CellVector res (it->second.size()); + std::vector> res (it->second.size()); for (unsigned int q = 0; q < res.size(); q++) res[q] = std::dynamic_pointer_cast(it->second[q]); return res; @@ -605,19 +600,19 @@ CellDataStorage::get_data(const CellIteratorType &cel template template -CellDataStorage::CellVector +std::vector > CellDataStorage::get_data(const CellIteratorType &cell) const { static_assert(std::is_base_of::value, "User's T class should be derived from user's DataType class"); - const typename std::map >::const_iterator it = map.find(cell); + auto it = map.find(cell); Assert(it != map.end(), ExcMessage("Could not find QP data for the cell")); // Cast base class to the desired class. This has to be done irrespectively of // T==DataType as we need to return shapred_ptr to make sure the user // does not modify the content of QP objects - CellVector res (it->second.size()); + std::vector> res (it->second.size()); for (unsigned int q = 0; q < res.size(); q++) res[q] = std::dynamic_pointer_cast(it->second[q]); return res;