add a scalar template to eoInt

Some applications may want size_t instead of a siméle int, for
example.
This commit is contained in:
Johann Dreo 2020-09-21 17:40:49 +02:00
commit 8f949409e7

View file

@ -36,7 +36,7 @@
* *
* @ingroup Representations * @ingroup Representations
*/ */
template <class FitT> class eoInt: public eoVector<FitT, int> template <class FitT, class T = size_t> class eoInt: public eoVector<FitT, T>
{ {
public: public:
@ -45,14 +45,14 @@ template <class FitT> class eoInt: public eoVector<FitT, int>
* @param size Size of the std::vector * @param size Size of the std::vector
* @param value fill the vector with this value * @param value fill the vector with this value
*/ */
eoInt(unsigned size = 0, int value = 0) : eoInt(unsigned size = 0, T value = 0) :
eoVector<FitT, int>(size, value) eoVector<FitT, T>(size, value)
{} {}
/** Constructor copying from a vector (or an initialization list). /** Constructor copying from a vector (or an initialization list).
*/ */
eoInt(std::vector<int> vec) : eoInt(std::vector<T> vec) :
eoVector<FitT, int>(vec) eoVector<FitT, T>(vec)
{} {}
/// My class name. /// My class name.