Skip to main content

All Questions

Tagged with
3 votes
3 answers
150 views

Linked List Interview Code methods, runtime, and edge cases refactored

In my previous post I had a number of steps given to me from the accepted answer on how I can write more production ready code. In this post I want this code to be reviewed as near production code I'd ...
greg's user avatar
  • 1,017
2 votes
3 answers
124 views

Queue Interview Code basic methods made from struct Node

Thanks for all the feedback, I optimized the code here. Here I'm Writing a very simple Queue of struct Nodes with only these methods get_front(), ...
greg's user avatar
  • 1,017
0 votes
2 answers
565 views

Binary Search Tree implementation with unique pointers

I have implemented a binary search tree using templates and unique_ptr in C++ 11. At present, only insertion and deletion are implemented. Please provide your feedback for improvements. ...
bornfree's user avatar
  • 229
10 votes
3 answers
9k views

Implementing a binary tree in C++ using "std::unique_ptr"

I have implemented a simple binary search tree class in C++ using std::unique_ptr objects to hold the pointers to each node. In doing this I have come across a ...
tjwrona's user avatar
  • 499
9 votes
3 answers
3k views

Binary Search Tree implementation using smart pointers

I have implemented below code for binary search tree implementation using shared pointer. At present, I have considered only integers. It supports insertion and deletion of values. Also, a print ...
bornfree's user avatar
  • 229
7 votes
1 answer
444 views

unique_ptr basic implementation for single objects

This is an implementation to simulate the basic functionality of unique_ptr. This doesn't provide features like custom deleter and ...
kapil's user avatar
  • 229
15 votes
2 answers
1k views

C++11 smart pointer 'library'

Edit: NOTE I'm a C++ "beginner" still in undergrad trying to teach myself modern C++ (because they don't do that in uni) so I'm sure this is riddled with errors that I am unaware of. Made a subset of ...
sjh919's user avatar
  • 153
4 votes
1 answer
293 views

value_ptr<T> - a C++11 header-only, deep-copying smart pointer that preserves value semantics for polymorphic and undefined types (updated)

My previous iteration was here. I've since finalized the concept as described in the title, and would appreciate any feedback GitHub Link Introduction: ...
Tom's user avatar
  • 417
2 votes
0 answers
319 views

Yet Another Non-Intrusive Reference Counted Smart Pointer Implementation

I needed a reference counted smart pointer for my project, and for some reason early in my project, I decided that I did not like the std::shared_ptr. I can't ...
Super Cyb0rg's user avatar
5 votes
1 answer
1k views

Graceful thread shutdown with std::move [closed]

I have a thread as part of a class that access the class's data members. The class has a move constructor that moves some of the old class's data members into the new object being constructed. Before ...
Sagar Jha's user avatar
  • 161
1 vote
1 answer
105 views

Single Linked List - simple approach

I am a student, trying to learn C++11 and data structures. I would like to ask you to to review my code. I have spent some time and analyse similar questions on Code Review and it gave me basic idea ...
pb.'s user avatar
  • 133
3 votes
2 answers
4k views

Copy-and-Move Concept Using Smart Pointer

I tried to implement a simple container class using the copy-and-move idiom. I am learning the changes to C++ as of C++11 and later. Is the code exception safe? I chose to use a smart pointer. Is <...
Henning's user avatar
  • 31
11 votes
2 answers
3k views

Trie Data Structure Implementation in C++11 using Smart Pointers -- follow-up

Link to my first question. Link to my latest source code. I followed @JDługosz recommendations. How does it look? Do you have any further recommendations? Is it better (if possible) to replace ...
user avatar
1 vote
1 answer
2k views

Returning containers from function - C++ [closed]

I've been trying to implement a few interfaces for processing data. And most of the time I do new of container and return a smart pointer to this container. ...
Shivendra Mishra's user avatar
1 vote
0 answers
1k views

C++11 CLH Lock Implementation

As a hobbyist programmer I have been reading "The Art of Multiprocessor Programming" (Herlihy, Maurice; Shavit, Nir) and converting the Java spin locks into C++ - I have enjoyed this and learned a lot....
headwedge's user avatar

15 30 50 per page
1
2
3 4 5
7