File: VectorUtils.hpp

package info (click to toggle)
pbseqlib 0~20161219-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 5,924 kB
  • ctags: 5,123
  • sloc: cpp: 82,727; makefile: 305; python: 239; sh: 8
file content (17 lines) | stat: -rw-r--r-- 409 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#ifndef _BLASR_VECTOR_UTILS_HPP_
#define _BLASR_VECTOR_UTILS_HPP_

#include <vector>

// Clear all memory allocated by this vector
template <typename T>
void ClearMemory(std::vector<T> & vt) {
    // Create an empty vector
    std::vector<T> emptyVector;
    // First clear the content
    vt.clear();
    // Then swap vt with the empty vector 
    vt.swap(emptyVector);
}

#endif // _BLASR_VECTOR_UTILS_HPP_