bpp-core3  3.0.0
BppVector.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: The Bio++ Development Group
2 //
3 // SPDX-License-Identifier: CECILL-2.1
4 
5 #ifndef BPP_BPPVECTOR_H
6 #define BPP_BPPVECTOR_H
7 
8 #include <utility>
9 #include <vector>
10 
11 #include "Clonable.h"
12 
13 namespace bpp
14 {
19 template<typename T>
20 class BppVector :
21  public Clonable,
22  public std::vector<T>
23 {
24 public:
25  template<typename ... Args>
26  BppVector(Args&&... args) :
27  std::vector<T>(std::forward<Args>(args)...)
28  {}
29 
30  BppVector<T>* clone() const { return new BppVector<T>(*this); }
31 
32  const std::vector<T>& toSTL() const { return *this; }
33  std::vector<T>& toSTL() { return *this; }
34 };
35 } // namespace bpp
36 #endif // BPP_BPPVECTOR_H
const std::vector< T > & toSTL() const
Definition: BppVector.h:32
STL namespace.
BppVector(Args &&... args)
Definition: BppVector.h:26
BppVector< T > * clone() const
Create a copy of this object and send a pointer to it.
Definition: BppVector.h:30
The BppVector object class. This class extends the std::vector class to support the Clonable interfac...
Definition: BppVector.h:20
std::vector< T > & toSTL()
Definition: BppVector.h:33
The Clonable interface (allow an object to be cloned).
Definition: Clonable.h:63