This project is part of the curriculum of School 21. As part of this project, we developed a standard C++ STL library from scratch, including sequential, associative, and derived containers. This educational project enhanced our team development skills, architecture design prior to implementation, taught us how to work with templates in C++, and solidified our object-oriented programming skills.
Russian version of README you can find here
- Contributors
- Getting started
2.1. Prerequisites
2.2. Steps to install and useful commands - Technical specifications
- Test results
- The containers of the Standart Template Library(STL)
Member | Area of responsibility |
---|---|
// sheritsh |
vector array |
// bradamar |
deque list queue stack |
// oznakban |
AVLTree set map |
// melodiea |
- Project and code supporting - Developments on vector and list - Test coverage |
Please install the following software before starting development:
- Clone repository
- Run
make
- to build project and run tests make check_style
- to check source code for Google Stylemake leaks
/make valgrind
- to check project for leaks and right memory access
If you wanna include 's21_containers.h' or 's21_containersplus.h' remember to use s21 namespace before containers.
Example:
s21::array<int, 5> arr = {1, 2, 3, 4, 5};
- Programming Language and Compiler:
- Implement the program in C++17.
- Use the GCC compiler for compilation.
- Code Organization:
- Organize the program code within the src folder.
- Coding Style:
- Adhere to the Google coding style guidelines for consistency and readability.
- Namespace and Templates:
- Implement classes within the s21 namespace.
- Use template classes for container implementations to support different types.
- Container Classes:
- Implement container classes: list, map, queue, set, stack, and vector.
- Provide standard constructors (default, copy, move, with initialization list).
- Implement methods for accessing, modifying, and managing container elements.
- Include methods to check if a container is full or empty.
- Iterators:
- Implement iterators for each container class.
- Provide begin() and end() methods to access iterators.
- Implement iterator operations: *iter, ++iter, --iter, iter1 == iter2, iter1 != iter2.
- Unit Testing:
- Develop comprehensive unit tests using the GTest library.
- Ensure test coverage for all container methods and edge cases.
- STL Logic and Exception Handling:
- Follow the logic of the Standard Template Library (STL) for checks, memory handling, and behavior in abnormal situations.
- Implement appropriate exception handling for error scenarios.
- s21_containers.h Library:
- Implement the s21_containers.h header file.
- Create separate header files (e.g., s21_list.h, s21_map.h) for each container class implementation.
- Base the implementation on classical container paradigms, with flexibility in algorithm choices.
- Makefile:
- Provide a Makefile to compile and test the library.
- Include targets for cleaning (clean) and testing (test).
- s21_containersplus.h Library (Bonus):
- Implement the s21_containersplus.h header file for additional container classes.
- Include classes: array and multiset.
- Base implementation on classical paradigms, allowing algorithm customization.
- Insert_many Method (Bonus):
- Extend container classes with specified insert_many methods.
- Implement the method variations for different containers as indicated in the table.
- Support variable numbers of parameters using the parameter pack construct.
- Documentation and Comments:
- Provide clear and concise code comments to explain the functionality and logic.
- Include necessary documentation for container classes and methods.
- Testing and Validation:
- Thoroughly test all implemented classes and methods for correctness and efficiency.
- Include boundary tests and edge cases in the testing suite.
- Final Deliverables:
- Submit the complete project, including source code, header files, Makefile, and test suite.
Using the Google Test Framework, all containers and their methods, including error handling, were covered with tests. This ensures comprehensive test coverage for the code and guarantees proper program behavior, including correct error handling. Excellent work in adopting such an approach!