# | Line 1 | Line 1 | |
---|---|---|
1 | < | /* |
1 | > | /* |
2 | * Copyright (c) 2005 The University of Notre Dame. All Rights Reserved. | |
3 | * | |
4 | * The University of Notre Dame grants you ("Licensee") a | |
# | Line 48 | Line 48 | |
48 | ||
49 | #ifndef UTILS_MEMORYUTILS_HPP | |
50 | #define UTILS_MEMORYUTILS_HPP | |
51 | – | #include <vector> |
51 | ||
52 | + | |
53 | namespace oopse { | |
54 | < | class MemoryUtils{ |
55 | < | public: |
54 | > | class MemoryUtils{ |
55 | > | public: |
56 | ||
57 | < | template<typename ElemType> |
58 | < | static void deleteVectorOfPointer(std::vector<ElemType*>& container){ |
59 | < | for (typename std::vector<ElemType*>::iterator i = container.begin(); i != container.end(); i++) { |
60 | < | delete *i; |
61 | < | } |
57 | > | template<typename ContainterType> |
58 | > | static void deletePointers(ContainterType& container) { |
59 | > | for (typename ContainterType::iterator i = container.begin(); i != container.end(); i++) { |
60 | > | delete *i; |
61 | > | } |
62 | ||
63 | < | container.clear(); |
64 | < | } |
65 | < | }; |
63 | > | container.clear(); |
64 | > | } |
65 | > | }; |
66 | } | |
67 | #endif //UTILS_MEMORYUTILS_HPP |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |