summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkdx <kdx.42@42l.fr>2023-01-06 09:20:36 +0100
committerkdx <kdx.42@42l.fr>2023-01-06 09:20:36 +0100
commit1eaf09c20a0938b5dce6cac60df545a4d13b37e3 (patch)
tree328f38208dc3687b5a0209a11421fc1112931481
download42-containers-1eaf09c20a0938b5dce6cac60df545a4d13b37e3.tar.gz
kekchoz
-rw-r--r--Makefile25
-rw-r--r--main.cpp8
-rw-r--r--vector.hpp27
3 files changed, 60 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..811a240
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,25 @@
+CC := c++
+CFLAGS := -O3 -Wall -Wextra -Werror -std=c++98
+SRC := main.cpp
+OBJ := $(patsubst %.cpp,%.o,$(SRC))
+NAME := a.out
+
+all: $(NAME)
+
+$(NAME): $(OBJ)
+ $(CC) -o $(NAME) $(OBJ)
+
+%.o: %.cpp
+ $(CC) $(CFLAGS) -c -o $@ $<
+
+clean:
+ rm -f $(OBJ)
+
+fclean:
+ rm -f $(OBJ) $(NAME)
+
+re:
+ make fclean
+ make
+
+.PHONY: all clean fclean re
diff --git a/main.cpp b/main.cpp
new file mode 100644
index 0000000..bd7b6ec
--- /dev/null
+++ b/main.cpp
@@ -0,0 +1,8 @@
+#include "vector.hpp"
+
+int main()
+{
+ ft::vector<int> vec;
+ (void)vec;
+ return 0;
+}
diff --git a/vector.hpp b/vector.hpp
new file mode 100644
index 0000000..ca3ff98
--- /dev/null
+++ b/vector.hpp
@@ -0,0 +1,27 @@
+#pragma once
+#include <memory>
+
+namespace ft {
+ template <
+ class T,
+ class Allocator = std::allocator<T>
+ > class vector {
+ private:
+ typedef T value_type;
+ typedef Allocator allocator_type;
+ typedef std::size_t size_type;
+ typedef std::ptrdiff_t difference_type;
+ typedef value_type& reference;
+ typedef const value_type& const_reference;
+ typedef typename Allocator::pointer pointer;
+ typedef void iterator;
+ typedef void const_iterator;
+ typedef void reverse_iterator;
+ typedef void const_reverse_iterator;
+ public:
+ vector();
+ explicit vector(const Allocator& alloc);
+ //explicit vector(size_type count, );
+ ~vector();
+ };
+}