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.

Filter by
Sorted by
Tagged with
0
votes
0answers
37 views

Would compiler optimization remove try/catch block if catch does nothing? [migrated]

I am working with code that has a lot of try catch blocks in but most cases the catch blocks ...
5
votes
2answers
117 views

C++ template class to caculate CRC

Here is a template class to calculate various CRC checksums. I go out my way to achieve a good C++ encapsulation for a C style code . Any advice or suggestion is welcome. ...
2
votes
1answer
47 views

watchdog for c++11

I created a watchdog/notifier in C++ and wanted to make it better so it could be used by multiple people. The idea is that there is a timer class and event. client create events and pass a lambda ...
0
votes
1answer
52 views

The Abstract Factory design pattern as a Database Operations program

File - DatabaseOperations.h This file contain classes representing database operations for three different types of databases (relational, document based and graph based) like establishing connections,...
2
votes
3answers
92 views

Factory Method Design Pattern Implementation as a Coffee maker program

File: InfoFactory.h contains four classes. CaffienatedBeverage is an Abstract class with one pure virtual function Name. It ...
3
votes
3answers
522 views

Connect to telnet server

I've just started to learn C++. I have this class and I don't know where to put the following two lines because of the catch: delete[] chost; delete[] cport; I ...
3
votes
2answers
216 views

An implementation of the PIMPL idiom [closed]

I would like to ask you to verify the following implementation of the PIMPL idiom. In this dummy implementation the stream is read into a string. X.h ...
1
vote
0answers
42 views

template Matrix class with Static or dynamic size

I started implementing the folowing Matrix class in order to get a better understanding of templates classes in general. For now, it lacks a lot of features, it does very basic things: addition ...
0
votes
0answers
27 views

Refactoring a simple ZeroMQ Server

I have a simple ZeroMQ client from zmqClient. I have refactored the code and done the following things. Created a class ZmqServer and added member variables and methods. Added a Server thread, using ...
2
votes
1answer
44 views

Decoupling receiving data and processing data by passing callback and shared_ptr

Sorry for my poor English. I want to decouple receiving data and processing data, this is the demo code: ...
3
votes
2answers
101 views

C++11 ThreadPool implementation

A new version of this code based on the provided advice can be found here. Latest improvement is found here. I made a simple ThreadPool implementation in C++ using ...
3
votes
1answer
159 views

Conditional Output Streaming in C++

I stumbled into an idea for creating a simple class that would entirely avoid streaming of any data unless some condition is met. The idea here is that a ...
12
votes
1answer
1k views

Simple NAPI wrapper around self written C++ msgpack, horrible performance

I have written a relatively small msgpack implementation in C++, with performance that is not too bad, so I decided to write a NAPI wrapper around it, but the performance is just horrible. I am ...
2
votes
1answer
152 views

Simple Rock Paper Scissors

I made a Rock Paper Scissors game. It works fine but I would like to know how can I improve it further. ...
7
votes
6answers
3k views

C++ implementation of depth-first search

I got the C++ implementation of depth-first search (DFS) from here and made slight modifications to it. The modified code is as follows: ...
0
votes
0answers
46 views

Optimizing matrix vector multiplication with keyword "register" and unsafe pointer arithmetic

I know this piece of code is quite strange, but it does its job very well performance-wise , reducing the running time of a very computation intensive operation by 3 - 5 times without using a better ...
1
vote
1answer
399 views

dynamic_pointer_cast for std::unique_ptr

dynamic_pointer_cast is only implemented for std::shared_ptr, I need it for unique pointers. The wrinkle is that dynamic_casting ...
8
votes
3answers
982 views

C++ Creating custom vector

I am new to C++ and Data structures, so I have started writing a custom vector as a practice. Please provide critique and advice. I know it is quite long, so thank you very much in advance. I just ...
2
votes
3answers
134 views

LRU Cache Implementation in C++

I am learning C++ by implementing small design problems. I have tried to implement LRU cache and the implementation that I have attached here works fine. However, I am not sure whether my code is in ...
6
votes
2answers
546 views

shared_ptr and make_shared implementations (for learning)

Recently, I've been going through Scott Meyer's Effective Modern C++ and found the discussion on shared_ptr really interesting. I also watched Louis Brandy's ...
1
vote
1answer
58 views

Household Outgoings Calculator (OOP)

I would really appreciate feedback on my OOP Household Outgoings calculator. My objective is to develop in OOP. Have I used good OOP techniques? How can I improve on it? And anything else you might ...
1
vote
1answer
54 views

generating stochastic coloured noise for many oscillators

I have a system of n oscillators which oscillate with time. To each of these oscillators I am adding a fluctuating coloured noise term with a different seed for each oscillator. Here is my code for ...
1
vote
1answer
42 views

Priority scheduling algorithm using std::vector

I'm learning priority scheduling algorithm and trying to implement it using std::vector. But the current performance of my code that's partially implemented is not ...
10
votes
1answer
4k views

Deck of Cards written in C++

I created a deck of cards that I used in a BlackJack game. I stripped out my black jack logic and left just the Deck, card and minimum dealer. The deck class is there because I want to create ...
3
votes
1answer
76 views

Random index generator in C++

I have a training dataset from which I want to draw samples in a random fashion such that all samples are used before getting randomly shuffled again. For this reason I implemented a simple random ...
0
votes
1answer
48 views

C++ Error/exception handling [closed]

I know the following code are horrible, so I'd like a review. Criticism are welcome. I want to know what went wrong, and how I can avoid the same mistake in the future. Version 1 ...
7
votes
1answer
204 views

Modular synthesizer framework for C++

While working on a much more complicated audio application, I was thinking about modular synthesizers, and whether it could be made simple to build a C++ application that implemented a modular ...
2
votes
1answer
79 views

An Implementation of Two Dimensional Plane as Monochromic Image Container with std::unique_ptr in C++

I am trying to implement a monochromic image container with std::unique_ptr. The example usages The example usages is as below. ...
13
votes
5answers
2k views

Simple dataset class in C++

As part of my training, I implemented a dataset class in C++ that allows me to create synthetic datasets to get more familiar with features that C++ offers such as object oriented programming. This ...
2
votes
2answers
214 views

My String Class

Here's my very basic String class. This is my first attempt, to try to design and write a basic String class in C++, without using the absolute new features provided by newer C++. ...
7
votes
2answers
452 views

Using c++11 random header to generate random numbers

I'm new to programming. I have a question regarding the usage of c++11 random header to generate random numbers. I tried to learn it, but was unsuccessful. Recently, I've tried the following approach ...
1
vote
1answer
40 views

Find the next number with all different digits, and no 0 or 2

Task Input - integer number (year) Print one number - the next year, in which all digits are pairwise different, and there are no digits 2 and 0. If there will never be such a year, print ...
3
votes
1answer
83 views

Grade Calculator (New OOP Version from one previous)

I'm trying to develop an OOP way of thinking. I was hoping someone would be kind enough to spare some of their valuable time to review my Grade Calculator OOP program. As always, I'd like to know what ...
4
votes
1answer
323 views

Noughts & Crosses UML Class Diagram

I was told I need code in order for someone to review my UML Class Diagram for my Noughts and Crosses console application. I would like to know if it's intuitive, whether you could make a program ...
3
votes
2answers
811 views

Tic Tac Toe (New OOP Design)

Would someone be able to review my latest OOP design of my Tic Tac Toe / Noughts & Crosses program? I’d like to know what I’ve done well and whether I could improve the OOP Design. Many thanks in ...
1
vote
2answers
116 views

Loan System Calculator

I would really like feedback on this Loan System Calculator. My goal is to get better at OOP design and would like to know if I've done a good job in making this scenario OOP? Could I have structured ...
4
votes
1answer
147 views

wrapper class for random access iterator to hide template method implementation from header file

I have a set of template functions that have itrator types as template parameters, so can be used with any kind of iterators. std::find can be a good example. Also ...
6
votes
1answer
81 views

External sorting with async read and write

I wrote this code for a home task, and received some negative feedback. Though I really appreciated the reviewer, but I disagree when he said I use auto disorderly, ...
2
votes
2answers
103 views

Noughts & Crosses (Tic Tac Toe) OOP Design

I was wondering if someone could review my object oriented design for my Noughts & Crosses program. Yesterday I posted a procedural version and now I've done an OOP version. Can someone tell me ...
1
vote
2answers
132 views

Either monad in C++11

I'm using C++11 with https://github.com/SmingHub/Sming. It has no support of std lib or exceptions. I wanted to use Either monad ...
6
votes
1answer
122 views

Graph implementation with Dijkstra

So, here is the code: ...
5
votes
4answers
847 views

Tax Calculator (using OOP techniques)

I was wondering if you'd be able to review my basic Tax Calculator that incorporates OOP techniques. I'd greatly appreciate it if you didn't mention about my variable naming convention i.e. Hungarian ...
7
votes
2answers
363 views

Doubly Linked List Data Structure ADT in C++

I'm trying to implement a Doubly Linked List data structure in C++. Please give me suggestions on how this code can be improved. Try to remain in C++11 because that's what I know atm. ...
5
votes
1answer
121 views

C++ Queue Circular Array Implementation

I'm trying to implement a queue data structure in C++ using a circular array. Please give recommendations on how I can improve this code. Also, is my array growth strategy good? I'm doubling the array ...
7
votes
2answers
498 views

Validating ISBN-10s, with or without dashes in C++11

Description A regex-based method of validating ISBN-10 as strings. Can be digits (or 'X' at the end) only, or with dashes, according to those of English-speaking publications (which are defined by the ...
5
votes
3answers
374 views

Personal Finance Management Tool (OOP version)

CodeReview Community! I was hoping you'd be able to review my basic OOP program. Last year I did a strictly procedural one and now I’ve incorporated OOP techniques. Ignore the commented out piece of ...
11
votes
5answers
2k views

Grade Calculator (using OOP techniques)

I was wondering if you'd be able to review my basic C++ Grade Calculator I based off the following scenario. I would like to know what I've done well vs what I haven't done well. Many thanks in ...
4
votes
1answer
95 views

Kernel Interpolation C++

Purpose of this program is to calculate the velocity of ng = nxnynz particles at the Lagrangian points from the values at regular grid nodes. How can i speed up this calculation? I hope to receive ...
5
votes
3answers
233 views

A FIR filter using Modern C++ features

I'm diving into "modern CPP", with wide usage of templates and containers, So I started with FIR filter. In signal processing, a finite impulse response (FIR) filter is a filter whose ...
4
votes
3answers
153 views

Calculation of Energy Spectrum using C++

My purpose is to calculate the energy spectrum of three-dimensional turbulent flow from three velocity components. The calculation is too expensive. Therefore, I hope the calculation time can be ...

1
2 3 4 5
34