# Tag Info

### I created something much faster than a std::string

Unfortunately, your implementation is slower (sometimes substantially slower) than std::string according to your own benchmarks in every test but "create by ...
• 4,469

### I created something much faster than a std::string

I’m not going to bother with a full review since the OP is already moving on to v2 of this project. But I think there are some very interesting things that could be helpful to many people still worth ...
• 9,431
Accepted

### Implementing any_of in C++

The algorithm looks correct. Regarding the function signature, I'd make three changes: You're not modifying elements, so take it by constant reference rather than reference. You don't need to ...
• 1,354
Accepted

### std::list reimplementation

As mentioned, this is a re-implementation of std::vector, not std::list. The default constructor can be set as ...
• 1,687

### I created something much faster than a std::string

General Advice Writing a new string class is a very common exercise. You are probably not going to be able to beat the performance of the STL unless you change the contract of the STL—either the API ...
• 2,503

### Implementing any_of in C++

I think you did a pretty good job as a beginner. In addition to what Errorsatz said: Consider making element a const reference to prevent unnecessary copying: <...
• 9,269

### C++ lock-free, MPMC Ring buffer in C++20

I'm mostly going to play advocate for the devil here. Lock-free doesn't mean fast There is a rather persistent misconception that lock-free algorithms are faster than locking algorithms. However, that ...
• 38.2k
Accepted

### C++20 : Simple Softmax classifier for MNIST dataset

In addition to Toby Speight's remarks, I would add: Use constexpr for all constants I see you already used constexpr for ...
• 38.2k

### 2D Collision Detection in C++

const bool Game::isColliding(... This indicates that the returned type is const, and should not be modified by any part of your ...
• 368
Accepted

### C++ basic bank money class

Store Money as Fixed-Point Monetary quantities are the classic example of something that might have fractional values, but you do not want to represent as a floating-point number, because you need ...
• 2,503

### Checking for NaN bit patterns in C++

First of all, the compiler is not hostile; by using -ffast-math you are asking for an optimization that the compiler dutifully performs. Perhaps it is not what you ...
• 38.2k
Accepted

### Block-free priority lock

Should You Really Create the High-Priority Mutex Separately? This introduces a new, invalid state (where the high-priority mutex hasn’t been created yet), and prevents you from checking multiple state ...
• 2,503

### Palindrome Permutation string

#include <vector> is unnecessary for this program. There are clearly insufficient tests, because there's a bug here: ...
• 63k
Accepted

### 2D Collision Detection in C++

SFML implements functionalities that allow you to determine if two rectangles intersect. You can significantly shorten your current code: ...
• 290

### I created something much faster than a std::string

Correctness The correctness of code is always important when it compares with the speed / performance. There is nothing useful for running fast and generating unexpected results, especially dealing ...
• 3,646

### 2D Collision Detection in C++

John's answer is correct on programming matters. I want to comment on the logic of your code. I found the collision detection calculation difficult to interpret. Which point on the square is ...
• 1,795

### C++20 : Simple Softmax classifier for MNIST dataset

That's a very big list of includes! It might be a sign that you have functionality that should be split out to separate source files (e.g. filesystem read/write away from the core computation). ...
• 63k

### std::list reimplementation

The front, back, and swap methods don't check for an empty list. You leak a lot of memory. ...
• 7,636

### Block-free priority lock

Don't use CAS for bools There is no need to use atomic compare-and-swap when toggling a boolean value. Consider that if you want to set the flag to ...
• 38.2k

### I created something much faster than a std::string

The reason lies in the way I handle the heap memory, I don't need to realloc memory every time the value changes, and I don't need to completely reset the object when any modification is made. ...
Accepted

### Goat racing up a hill (C++ hiring take-home)

M_SQRT2 is not part of the standard library and does not exist on all conforming implementations. The portable C++20 version is ...
• 9,269
Accepted

### Portable Object-Oriented WC (Linux Utility word Count) C++ 20, Counts Lines, Words Bytes

Usability Sorting the files in output is surprising, given that commonly-used implementations produce output in the same order that the files were specified. Scripts likely depend on the order ...
• 63k
Accepted

### C++20 Vector2D Template

Overview Your code as written is perfectly fine (apart from the one bug in subtraction). Anything mentioned here is mainly to help future readers. You overcomplicated the design by adding constructors ...
• 92.3k

### C++ lock-free, MPMC Ring buffer in C++20

template<class T, uint8_t BitsForItemCount> class RingBuffer This is missing ...
• 63k
Accepted

### Checking whether a string is a permutation of a palindrome in C++20

While your algorithm is $O(n)$, the constant factors are considerable. Specifically, you are suffering due to all the nodes the map needs. Better options are: Just ...
• 18.2k
Accepted

### 3D Inverse Discrete Cosine Transformation Implementation in C++

Use std::uint8_t instead of BYTE I see you are declaring a type alias BYTE. However, I think ...
• 38.2k

### C++20 standard compatible vector

Non-conformance: [Derivation].4: All types speciﬁed in the C++ standard library shall be non-final types unless otherwise speciﬁed. std::vector is not an ...
• 18.2k
Accepted

### Max function with variable number of arguments

I think this function is unnecessary. We can deal with defective classes (that don't properly implement the standard LessThanComparable concept) by either fixing ...
• 63k
Accepted

### C++ class to create and evaluate Chebyshev approximations of arbitrary functions

Naming things You have a bounds checking evaluation function, operator(), and one that doesn't do bounds checking named ...
• 38.2k