Skip to main content

Questions tagged [c++14]

Code that is written to the 2014 version of the C++ standard. Use in conjunction with the 'c++' tag.

4 votes
1 answer
218 views

Fill vector of unique_ptr<derived> only with required derived types and enforce multiplicities constraints

I wrote a function that accepts a destination vector and a vector of all the types that are currently available. Its job is to iterate over all the available types (strings) and for each type, if it's ...
lia's user avatar
  • 43
2 votes
2 answers
164 views

Improved input validation function

A week ago I posted this question and after reading the answers and accepting one I decided to refactor my code quite heavily. I would like to get some feedback on this newer version. The changes No ...
globalturist's user avatar
2 votes
3 answers
183 views

Making an input validator function

NOTICE: I refactored the code and made a new question like was advised. I'm making an input validator function that is inspired by @JDługosz from the following post so that other new C++ programmers ...
globalturist's user avatar
3 votes
1 answer
224 views

Custom single-header C++ logging library

I started learning C++ recently for game development, and decided to write my own little library for debugging. Here is the library (snoop.hpp) ...
Marc's user avatar
  • 33
2 votes
1 answer
77 views

Force acquiring R/W lock

I am trying to build an abstraction that forces lock acquisition before data can be accessed. This seems to work, but please tell me if what I am doing horribly wrong, and what I could improve. I am ...
optimistic's user avatar
3 votes
2 answers
374 views

Concurrent Handle Table

I'm writing a data structure to solve a problem related to servicing hardware interrupts. I have to translate a 64-bit pointer to a 16-bit handle and back again. Unfortunately the hardware completions ...
BlamKiwi's user avatar
  • 181
1 vote
1 answer
594 views

Make C++ Task class similiar to C#'s Task

I am enjoying making various programs with C++. This is my first code review request. And I hope I can get some insights or might have good advice to make my code better. I make a task class using C++...
Y.frank's user avatar
  • 29
4 votes
3 answers
335 views

Optimize memory and disk usage for sequences of n-bit values

Motivation: I am working with sequences of n-bit values coming from an ADC. I was initially using a std::vector<unsigned short> to store these values (12 bit ...
lobis's user avatar
  • 61
9 votes
1 answer
1k views

Porting C-style socket to CPP class

I am porting the C-style socket to design a simple wrapper around the telnet client in CPP. The telnet protocol is accomplished by using libtelnet in C. The C-style code for this wrapper is reviewed ...
ravi's user avatar
  • 439
1 vote
1 answer
147 views

Simple networking framework in C++

Question: What do you think about this design and the implementation? This is a simple networking framework for IPv4, IPv6 TCP client and TCP server for Linux and MS-Windows in C++14. It uses a single-...
Andre Adrian's user avatar
2 votes
1 answer
717 views

Binding move-only objects to functions (for a thread pool implementation)

I recently implemented a thread pool using std::functions. I only supported functions taking no arguments on the assumption that there would be no need to have them ...
jezza's user avatar
  • 205
2 votes
2 answers
224 views

Nop class which can get optimized away

I designed a class for debug builds which does not incur any overhead in release mode. A usecase is for example: I have a function and I want to count how often it is called. For this I could write ...
tommsch's user avatar
  • 243
6 votes
5 answers
2k views

TString - An implementation of std::string

I wanted to make a feature rich string in C++. Similar to one in python. I am using C++14. I have not added much yet, I just want to get my code reviewed to ensure I am going the right way. Features: ...
Random_Pythoneer59's user avatar
1 vote
1 answer
108 views

One-time dynamic, many-time *almost* static type dispatch

Annoyed at the tension between good software design principles that require well-defined delimitations between interface and implementations, and the requirements for critical code to run fast, which ...
lurscher's user avatar
  • 141
2 votes
1 answer
207 views

C++ template and inheritance - Generic Sqrt Decomposition

So I tried implementing a easily extendable solution for Sqrt decompostion, I deduced that only identity value, operation and block update logic change and rest of the code is same. So i created 3 ...
Abhay Raj Singh's user avatar

15 30 50 per page
1
2 3 4 5
32