Questions tagged [c++11]

Code that is written to the 2011 version of the C++ standard, sometimes known by its pre-publication name of "C++0x". Use in conjunction with the 'c++' tag.

98 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
6 votes
0 answers
508 views

Console Command module (in-game console or base for script engine)

I've created a console/terminal command handling module that allows the programmer to bind functions to a command name and later execute them from std::string. What's new is that it handles most stuff ...
RippeR's user avatar
  • 161
5 votes
0 answers
1k views

Polymorphic deleter for unique_ptr

There is a basic difference in the way C++ manages the deleter for std::unique_ptr and std::shared_ptr, mainly for allowing ...
Amir Kirsh's user avatar
5 votes
0 answers
163 views

Delegated condition_variable against spurious wakeup

This is my attempt at dealing with spurious wakeups: A new class which replaced std::condition_variable in my code. Some questions which came to my mind are (and I ...
PhilLab's user avatar
  • 193
5 votes
0 answers
92 views

Iterator structure for block and interlace counting schemes

We have a set of time slices, in the order of 50. Throughout this question I will use 6. We group these slices into blocks, in this example the block size is 2. Then we want to iterate through all ...
Martin Ueding's user avatar
5 votes
0 answers
162 views

Using SFINAE with wrappers to terminate compilation early

The Goal Provide some wrappers to a C++11 template library's main entry point so that if the initial template parameter is not valid, the user is informed of exactly what is missing. In the real ...
svenevs's user avatar
  • 205
5 votes
0 answers
1k views

Tuple-like container for packed data

I'm writing some code which needs to be compatible accross a Cortex-M based embedded device and x86 / x86_64 based PCs. I needed a solution for sending binary data between the Cortex-M and the ...
Venemo's user avatar
  • 243
5 votes
0 answers
66 views

Using the llvm::iterator_adaptor_base

I'm currently working with the LLVM JIT framework. There is some graph I had to implement for internal cost bench-marking. It has cyclic node dependencies, so I have to use ...
Minor Threat's user avatar
5 votes
0 answers
204 views

Fake 3D effect in SFML - follow up 2

Based on my previous question, I have implemented all the recommendations received. In addition, i have implemented new features and completed road geometries. Here is a summary of the improvements: ...
MORTAL's user avatar
  • 3,278
5 votes
0 answers
1k views

C++ class "overload" using variadic templates and wrapped function pointers

I'm using C++11 and I have the following problem (pseudo C++): ...
jchnkl's user avatar
  • 51
4 votes
0 answers
151 views

Tic Tac Toe with different level AI

I've already created a code in python here with almost the same logic: Tic-Tac-Toe with changeable board size (Part 1) Tic-Tac-Toe with changeable board size (Part 2) Here's the code in C++. As I'm ...
Sriv's user avatar
  • 2,720
4 votes
0 answers
203 views

Recreated Microsoft's Console Registry Tool's query functionality in C++ (REG.exe)

I decided to try and recreate Microsoft's REG.exe query functionality."Reg.exe" is Microsoft's Console Registry Tool. I used Microsoft's documentation of "reg query" to recreate it's functionality ...
user36278's user avatar
  • 347
4 votes
0 answers
528 views

Persistent List with constexpr and pointers

I am trying to implement a linked list in C++, functional and persistent. Before looking into sample implementations, I tried to come up with my own as an exercise. I came up with two versions: One ...
meguli's user avatar
  • 215
4 votes
0 answers
125 views

C++11 Removable connection from emitter or receiver object

Please review my solution for the following problem. I am interested in: Maintainability Usability Logical correctness Efficiency Problem: It has 1+ objects each in separated thread and between the ...
István Simon's user avatar
4 votes
0 answers
1k views

Boost Asio Listener

I have developed a piece code to listen on a socket using Boost::asio. I would like to use that code in production. But before that, I would like to test it and ...
Kid's user avatar
  • 51
4 votes
0 answers
32 views

August 2016 Community Challenge: Rainfall Challenge (Late Answer)

Recently, I have gotten around implementing the rainfall challenge (which was the designated community challenge of August 2016) for practice purposes and would like to have some hints and ...
Ben Steffan's user avatar
  • 5,228
4 votes
0 answers
614 views

Pitch detection library, basic architecture

I'm a mechanical engineer/amateur programmer trying to learn modern C++. I'm working on a personal project where I'm building a library that uses PortAudio to abstract some basic audio processing, ...
mattj23's user avatar
  • 41
4 votes
0 answers
5k views

Network Bandwidth Usage Monitor

I have written a very basic bandwidth usage monitor in C++/winpcap. I would like to get some feedback, regarding design choices, implementation, style, correctness. (Or anything else you care to ...
smoothware's user avatar
4 votes
0 answers
1k views

C++11 generator implementation emulating Python's yield keyword

C++11's range-based loops allow convenient and easy iteration over containers, but what about more complicated iterations such as tree traversal? Usually this involves a lot of boilerplate code and ...
Lars Melchior's user avatar
4 votes
0 answers
411 views

Producer-consumer with a twist (consumer is a reader) in C++

Executive summary The twist is that the consumers do not consume, they just read. The producer makes items continuously in one of two alternating slots. Readers read from the other slot. When ...
Adrian Rosoga's user avatar
4 votes
0 answers
614 views

Compile-time plugin system (2)

Background This is a follow-up of this CR: Compile-time plugin system. The code exposed below can also be browsed on this gist, which shows the differences between both questions (original is version ...
Cilyan's user avatar
  • 285
4 votes
0 answers
179 views

Heap update generic algorithms

In the standard library, there are no algorithms for element updates. This makes it unsuitable as a queue for a Dijkstra's algorithm, for example. Thus I implemented generic heap update functions with ...
Ilya Popov's user avatar
4 votes
0 answers
1k views

C++ Finite State Machine - follow-up

This question is a follow-up from Object Oriented Finite State Machine. I vastly improved commenting and followed the suggestions from the answer. Additionally, I improved my tests and did some more ...
Justin's user avatar
  • 3,295
4 votes
0 answers
179 views

any that can hold arrays

I've tried to make a better any than before: ...
user1095108's user avatar
  • 1,414
3 votes
0 answers
107 views

Multithreaded OpenGL Rendering Pipeline

I've decided to move my rendering code to a separate thread, to help facilitate the move I've created a pipeline system for rendering. With this pipeline I can insert commands into a queue which will ...
vandench's user avatar
  • 153
3 votes
0 answers
317 views

C++ object pool using C memory pool as base

I started out with this question on Stack Overflow. I have since then gotten an official answer from the mbed developers that the MemoryPool that I was asking about only issued raw C malloc/free type ...
paulluap's user avatar
3 votes
0 answers
83 views

Determining if two packs are permutations of each other during compile-time

Often we need to find out if two tuples, or two packs in general, are the same as each other up to permutation. If there are no repeat types, then implementing ...
prestokeys's user avatar
  • 1,371
3 votes
0 answers
554 views

String conversion and stream insertion of std::ratio and std::chrono::duration

I've developed a set of functions to convert a std::ratio or std::chrono::duration to a ...
Null's user avatar
  • 1,433
3 votes
0 answers
2k views

A Simple K-Means Cluster Analyzer v0.1

[NOTE] This question can be depreciated in favor of version 0.2. This code works well. This my first attempt at creating a robust, computationally lean K-Means Cluster analyzer. I first saw this ...
Miller's user avatar
  • 533
3 votes
0 answers
31 views

ThorsSQL Lib: Part 3: Layer 5 Request/Response

Have a working version of MySQL implementation of ThorsSQL library done. If you want to check it out you can find the whole thing on github ThorsSQL. This is a follow on to previous code Reviews: ...
Martin York's user avatar
  • 94.6k
3 votes
0 answers
45 views

ThorsSQL Lib: Part 3: Layer 4

Have a working version of MySQL implementation of ThorsSQL library done. If you want to check it out you can find the whole thing on github ThorsSQL. This is a follow on to previous code Reviews: ...
Martin York's user avatar
  • 94.6k
3 votes
0 answers
279 views

Simple C++11 Subject-Observer

Building on the answer in C++ class member callback simple examples, I've tried to put together a simple subject-observer pattern without needing to inherit a virtual Observer class. I also wanted to ...
rsjaffe's user avatar
  • 253
3 votes
0 answers
2k views

Multiple readers, single writer synchronization

This is educational purpose "simulation" of multiple readers / single writer server. No actual work is done, except the synchronization. In current realization, readers have priority over writers. <...
Nick's user avatar
  • 1,572
3 votes
0 answers
377 views

Merge two sorted linked lists in C++

Should I be using std::move or copy when passing LNode in the LinkedList constructor instead ...
user1044328's user avatar
3 votes
0 answers
123 views

Substitute for `std::array::operator[]` in C++11 by using template-based recursion

What follows is a simplified version of a tentative implementation for a template-based set, named TemplateArgs. For the sake of clarity and focus on the question ...
Flávio Lisbôa's user avatar
3 votes
0 answers
575 views

C++ STL graph implementation with out and in adjacency list

I'm looking for a code review on the following C++/STL graph implementation: Edge ...
vgauthier's user avatar
3 votes
0 answers
78 views

Optimising insert operation for btree

I'm working on implementation insert operation for a btree, and would like to know if there is any way to optimise the inserting operation to make it go faster. The code seems really long so I'm ...
Ivan's user avatar
  • 131
3 votes
0 answers
2k views

Dijkstra's single source shortest path algorithm (with Fibonacci heap)

I implemented a generic Dijkstra algorithm. It's lazy since the vertices with their final distances are request on demand. I used the Fibonacci Heap from this question with a few changes (added a copy ...
MAG's user avatar
  • 2,944
3 votes
0 answers
3k views

In-memory B+ Tree in C++

I know B+ trees are not meant to be use in memory, but I just implemented it as an exercise. I'm looking for a general review. ...
MAG's user avatar
  • 2,944
3 votes
0 answers
852 views

C++ Event Emitter

I needed an event bus in C++ with a few features: Possibility to add/remove both functions and member methods. Ability to remove automatically those listeners that wrap member methods of expired ...
skypjack's user avatar
  • 131
3 votes
0 answers
1k views

C++ UDP server for a game

I broke my server into two classes, a general server class and a client session class. I know the code isn't documented in the header, but I am more interested in the design of the server/session ...
shane's user avatar
  • 171
3 votes
0 answers
204 views

Simple Snake Game - Follow-up 2

Based on the previous question, I have implemented all suggestions. Also, I worked a bit in this project to improve it. Summary of improvements: split the code into multiple files as .hpp and .cpp ...
MORTAL's user avatar
  • 3,278
3 votes
0 answers
222 views

Threadsafe singleton factory to use in Apache thrift server RPC system

My goal was to write a factory that the code did not have to be edited. Thus I am registering my factory functions into a singleton factory. I am going to be using this code in Apache thrift server ...
user249806's user avatar
3 votes
0 answers
56 views

Iterator range for console class that handles multiple buffers

This question is a spiritual successor to Console class that handles multiple buffers. I was mostly interested in implementing one of the suggestions of using an iterator range and fixing the ...
user86418's user avatar
3 votes
0 answers
378 views

Factory with raw pointers

I'm designing a Factory in C++ with raw pointers, but I'd like to use smart pointers when possible as is recommended with the Factory pattern in newer C++. Unfortunately my compiler is a bit old (gcc ...
erip's user avatar
  • 916
3 votes
0 answers
1k views

A map class based on an AVL tree

Here's an implementation of a class which is similar to std::map, but it's not a complete/identical implementation. I know C pretty well, but am a beginner with C++...
Paul's user avatar
  • 131
3 votes
0 answers
477 views

Entity Component System in C++11

An Entity Component System works by grouping various components around a central ID, aka Entity. Entities and Components do not have any code, they are simply POD containers. Rather, the code lies in ...
Daniel Martin's user avatar
3 votes
0 answers
1k views

Efficient compile-time directed graph

During my research in Rigid Body Dynamics, (where Contact Graphs are used to solve the contact problem) I came across the question if it is possible to define at compile time a directed graph (class) ...
Gabriel's user avatar
  • 323
3 votes
0 answers
229 views

Simple Win32 console library (mimicking almighty SFML) - follow-up

I'm trying to mimic the SFML library to be suitable for text-based games. The library called MSLIB in GitHub here. Here is a sample of the library implementation. It prints gray square onto the ...
MORTAL's user avatar
  • 3,278
3 votes
0 answers
117 views

Counting words in files - follow-up 2

Previous question: Counting words in files - follow-up I have fixed punctuation problems in my previous code by using template, because it is easy to understand and my focus on template mechanism. ...
MORTAL's user avatar
  • 3,278
3 votes
0 answers
1k views

Universal "call" function

I need a function call(f, args...) which calls the "function" f with the arguments args.... ...
leemes's user avatar
  • 495