Skip to main content

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.

-2 votes
0 answers
30 views

Heap or stack initialized object [closed]

tl;dr; What is a proper way to initialize object on stack or on heap? I want to make a profiling tool that can track time for iterative purposes and for single measurements - so that I can use same ...
Danilo's user avatar
  • 191
0 votes
0 answers
33 views

Decoupling networking management with the processing of generating messages to be sent which may need some calculation

The code snippet below is used to read/write tcp message. And the messages are sent(i.e. the void Conversation::do_write(std::string content)) by other threads ...
John's user avatar
  • 457
8 votes
2 answers
835 views

Efficient file-copying utility using threads

The task is to implement simple 2 threaded "copy" tool. Tool should accept 2 parameters: source filename and target filename. Copying logic should be organized with help of 2 threads. First ...
rishi's user avatar
  • 181
4 votes
4 answers
1k views

A thread-safe simple logger

Since the vprintf is not thread-safe, so I use a std::mutex. It's a pity that there are a lot similar macros(both name and ...
John's user avatar
  • 457
8 votes
3 answers
116 views

Generic overloading bitwise functions to manipulate the enum type

Thanks to G. Sliepen, who gave me a lot very meaningful & useful advice on my implementation about overloading bit operators for a special scoped enum. Now I have modified the code snippet to ...
John's user avatar
  • 457
4 votes
1 answer
692 views

Using builder pattern and facade pattern in real project

The code below is used to upgrade the firmware of three different types of cameras. I am not good at design patterns. I wonder if it is suitable to use builder pattern and facade pattern here. Since ...
John's user avatar
  • 457
2 votes
1 answer
57 views

Overloading bit operators for scoped enum

The code snippet is used to record the status of several cameras. Since the enum class MODULE_ENABLED should not be used by the customers directly, I marked it as <...
John's user avatar
  • 457
4 votes
2 answers
188 views

A simple text editor

I just have learned the Command Pattern carefully. I try to use this pattern to implement a simple editor. Some code may need some improvements, say the instance of ...
John's user avatar
  • 457
4 votes
1 answer
310 views

c++ quicksort pivots

Is this code for quicksort using the first index as a pivot correct? Also if I want to use the last or middle index as a pivot how would the whole code change? ...
Kqehzo's user avatar
  • 41
5 votes
1 answer
235 views

C++ extended switch for any class

Was thinking about extending the C switch beyond integers. Here is what it came to - will gladly accept any suggestions for improvement. Note: "Any class" in the title is not quite correct - ...
johngo's user avatar
  • 51
4 votes
2 answers
385 views

Class for locking shared disk directory

I'm writing an application to sync files between two directories. In order to prevent simultaneous access to the shared directory from several computers, I implemented blocking of the shared directory....
Andrey Epifantsev's user avatar
3 votes
2 answers
189 views

Multithreaded disk scan

I'm writing an application to compare and sync folders on a disks. Scanning the contents of folders is performed in separate threads. I wrote a class to manage scan threads. The main application class ...
Andrey Epifantsev's user avatar
3 votes
1 answer
125 views

std::list reimplementation for practice

I used cppreference list to implement this simplified std::list. The CXX_STANDARD is 11. My questions are the usual: Is the ...
Abner's user avatar
  • 39
3 votes
1 answer
131 views

Improving execution time of physics, data acquisition triggering system simulation

Background I'm attempting to write a physics simulation code, one portion of which involves simulating the triggering system of some equipment. The equipment works as follows: environmental noise (...
MomentumEigenstate's user avatar
7 votes
1 answer
1k views

Pet Shelter in C++

The provided code represents an implementation of a Binary Search Tree (BST) in C++, specifically tailored for a "Pet ...
I_throw_but_dont_catch's user avatar

15 30 50 per page
1
2 3 4 5
115