File: utility.hpp

package info (click to toggle)
dnaclust 3-7
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 720 kB
  • sloc: cpp: 3,630; sh: 516; makefile: 64
file content (20 lines) | stat: -rw-r--r-- 368 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#ifndef UTILITY_HPP
#define UTILITY_HPP

#include <vector>

template<typename ElementType>
inline const ElementType *getPointerOfVector(const std::vector<ElementType> &v)
{
  return v.empty() ? 0 : &v[0];
}


template<typename ElementType>
inline ElementType *getPointerOfVector(std::vector<ElementType> &v)
{
  return v.empty() ? 0 : &v[0];
}


#endif // UTILITY_HPP