first implementation, badly, of allocator

This commit is contained in:
hugogogo
2022-06-01 15:41:14 +02:00
parent 0e51cc655c
commit 99f67b808c
5 changed files with 145 additions and 2 deletions

34
headers/ftvector.hpp Normal file
View File

@@ -0,0 +1,34 @@
#ifndef FTVECTOR_HPP
# define FTVECTOR_HPP
# include "colors.h"
# include <iostream>
# include <string>
# include <memory> // std::allocator
class ftvector {
public:
ftvector();
ftvector( ftvector const & src );
~ftvector();
ftvector & operator=( ftvector const & rhs );
unsigned int size() const;
void push_back(const int & element);
private:
unsigned int _size;
int * _mem_ptr;
std::allocator<int> _allocator;
// static std::string const ftvector::_bar;
};
//std::ostream & operator<<(std::ostream & o, ftvector const & rhs);
#endif

View File

@@ -2,6 +2,7 @@
# define TESTS_H
#include <vector>
#include <string>
# define TEST(s) \
{\