Skip to main content

All Questions

Tagged with or
14 votes
5 answers
2k views

I wrote Cooley-Tukey's FFT algorithm in C. And I want to know how safe is this code? Is it just trash? How can I make it more memory safe? ...
RudraSama's user avatar
  • 181
9 votes
2 answers
861 views

I would like to ask for a code review of my shared_ptr<T> implementation for design, code style. Any nitpicks will extremely useful for me. The features ...
Quasar's user avatar
  • 639
10 votes
6 answers
2k views

I've been learning C for a while, and I decided to make a simple kNN program. What can I do to improve the program? Am I doing memory management right? Can the structure of the code be improved in ...
Super Tux's user avatar
  • 313
4 votes
1 answer
126 views

The Design Patterns book chapter 3 about Creational Patterns starts with a maze game. They use the maze as an example throughout the chapter and instead of rooms they have also things like enchanted ...
elehtine's user avatar
  • 165
3 votes
1 answer
132 views

I’ve been experimenting with a minimal unique_ptr–style class to see Empty Base Class Optimization(EBCO) in action when the deleter is empty: ...
sam's user avatar
  • 503
7 votes
3 answers
1k views

I am trying to create golang inspired cancellable context in C++ for use in worker threads and other tasks. I have tried to avoid using raw pointers, but ever since I started writing C++ code, I ...
Mahdi Chaari's user avatar
4 votes
1 answer
151 views

I have a buffer implemented as a fixed-size std::vector with two begin and end pointers ...
Phil's user avatar
  • 41
14 votes
2 answers
597 views

I skimmed through the documentation on cppreference.com and put down the basic functionalities expected out of a unique_ptr<T> implementation. I coded up a ...
Quasar's user avatar
  • 639
6 votes
2 answers
793 views

Any comments/suggestions on this design? I just want to hold onto an ordered collection of messages. Each message can be one of several types. I'm using some code analogous to this currently in a ...
Taylor's user avatar
  • 303
5 votes
3 answers
433 views

In this code I implemented arrays that store their own size before the first element. To access it you need to go back exactly sizeof(size_t) bytes back. To free it,...
yurich's user avatar
  • 157
3 votes
2 answers
176 views

I just learned to deal with pointers and memory allocation stuff. Using that, I built a todo list app, and it works as far as I tested it. I didn't account for many user errors, so any suggestion to ...
Sarthak Hingankar's user avatar
5 votes
3 answers
914 views

I spent like half an hour programming up a set of functions to make the allocation / deallocate of pointers easier within a bigger project. I felt that they were satisfactory, but was wondering if ...
Zenais's user avatar
  • 75
1 vote
1 answer
291 views

Introduction / Motivation I like the CADRe (a.k.a. RAII) resource management idiom in C++. And I like std::span's; or perhaps I should say, I dislike the use of ...
einpoklum's user avatar
  • 2,099
3 votes
1 answer
111 views

I have developed an automatic differentiation module for my software. Usually AD comes in two forms; forward mode or reverse mode and very clever approaches, beyond me, might mix both. Typically the ...
Attack68's user avatar
  • 633
4 votes
1 answer
188 views

I've implemented a basic Trie that is supposed to work only with lowercase English letters. ...
csmathhc's user avatar
  • 143

15 30 50 per page
1
2 3 4 5
28