Skip to content

In this project, you will implement a few container types of the C++ standard template library.

Notifications You must be signed in to change notification settings

winash1618/ft_containers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ft_containers mkaruvan's 42 ft_containers Score

In this project, you will implement a few container types of the C++ standard template library.

  • Actual Status : Finished
  • Result : 125

forthebadge

Project Description:

  • Implement the following containers and turn in the necessary .hpp files with a Makefile:
    • vector: You don’t have to do the vector specialization.
    • map
    • stack
  • It will use your vector class as default underlying container. But it must still be compatible with other containers, the STL ones included. You can pass this assignment without the stack (80/100).
  • But if you want to do the bonus part, you have to implement the 3 mandatory containers: vector, map and stack.
  • You also have to implement:
    • std::iterator_traits
    • std::reverse_iterator
    • std::enable_if
    • Yes, it is C++11 but you will be able to implement it in a C++98 manner.
    • This is asked so you can discover SFINAE.
    • std::is_integral
    • std::equal and/or std::lexicographical_compare
    • std::pair
    • std::make_pair

Requirements:

  • The namespace must be ft.
  • Each inner data structure used in your containers must be logical and justified (this means using a simple array for map is not ok).
  • You cannot implement more public functions than the ones offered in the standard containers. Everything else must be private or protected. Each public function or variable must be justified.
  • All the member functions, non-member functions and overloads of the standard containers are expected.
  • You must follow the original naming. Take care of details.
  • If the container has an iterator system, you must implement it.
  • You must use std::allocator.
  • For non-member overloads, the keyword friend is allowed. Each use of friend must be justified and will be checked during evaluation.
  • Of course, for the implementation of std::map::value_compare, the keyword friend is allowed.
  • You can use https://www.cplusplus.com/ and https://cppreference.com/ as references.

Testing

  • You must also provide tests, at least a main.cpp, for your defense. You have to go further than the main given as example!
  • You must produce two binaries that run the same tests: one with your containers only, and the other one with the STL containers.
  • Compare outputs and performance / timing (your containers can be up to 20 times slower).
  • Test your containers with: ft::.
  • A main.cpp file is available to download on the intranet project page.

testers:

What's the advantage of using std::allocator instead of new in C++?

When should you use friend classes?

Writing a custom iterator in modern C++

map reference

Algorithms

About

In this project, you will implement a few container types of the C++ standard template library.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published