max_size.cpp 1.0 KB

123456789101112131415161718192021222324252627
  1. #include "max_size.h"
  2. template <typename T>
  3. IGL_INLINE int igl::max_size(const std::vector<T> & V)
  4. {
  5. int max_size = -1;
  6. for(
  7. typename std::vector<T>::const_iterator iter = V.begin();
  8. iter != V.end();
  9. iter++)
  10. {
  11. int size = (int)iter->size();
  12. max_size = (max_size > size ? max_size : size);
  13. }
  14. return max_size;
  15. }
  16. #ifndef IGL_HEADER_ONLY
  17. // Explicit template specialization
  18. // generated by autoexplicit.sh
  19. template int igl::max_size<std::vector<int, std::allocator<int> > >(std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > > const&);
  20. // generated by autoexplicit.sh
  21. template int igl::max_size<std::vector<double, std::allocator<double> > >(std::vector<std::vector<double, std::allocator<double> >, std::allocator<std::vector<double, std::allocator<double> > > > const&);
  22. template int igl::max_size<std::vector<bool, std::allocator<bool> > >(std::vector<std::vector<bool, std::allocator<bool> >, std::allocator<std::vector<bool, std::allocator<bool> > > > const&);
  23. #endif