Fading Coder

One Final Commit for the Last Sprint

Simplified Template Implementation of the C++ Standard Library Vector

Unlike the basic string implementation we built earlier, the vector here will be a template class. Separating declarations and definitions of template classes causes linker errors, so we implement both in a single vector.h file—this mirrors how standard library implementations (e.g., SGI STL for GCC...

Implementing a Custom Vector in C++

Implementing a Custom Vector in C++
Introduction Hello everyone, this is Xiamu's C++ study note. Here, I will explain the vector container from the C++ STL. This blog is suitable for those who are learning vector or want to deepen their understanding of STL. We will not only introduce the various features of vector but also implement...

C++ Stack and Queue as Container Adapters

Container Adapters The adapter pattern is a widely used, categorized design pattern for reusable code that converts one class's interface into a different interface expected by client code. In the C++ STL standard library, stack and queue can store elements just like native containers, but they are...

C++ STL String Operations and Usage Guide

This guide covers the C++ Standard Template Library (STL) string type, which encapsulates common string operations for ease of use. Too use it, include the <string> header. String Definition Define a string variable similarly to other variables: std::string text; String Initialization Initiali...