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.

5 votes
1 answer
404 views

I have solved a typical segment-tree problem, which lets you update one single value to another in the array, or to get, from i to j, the sum of each element multiplied by an integer B to the power of ...
turral's user avatar
  • 127
4 votes
2 answers
332 views

I have tried implemented a fast lock free Single producer single consumer queue in C++ for practicing concurrency and low level design concepts. I also benchmarked the code on x86_64 2.3GHz Intel ...
wwite's user avatar
  • 83
6 votes
1 answer
262 views

I'm a bit new to templates in C++ (I'm mostly a C guy) and wanted to see if I could create a result template. What I want to know is if there are any pitfalls/oversights in my code. You can assume ...
Daniel Walker's user avatar
2 votes
1 answer
113 views

TL;DR https://godbolt.org/z/TMfb8z99h ...
Sergey Kolesnik's user avatar
8 votes
2 answers
887 views

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
2k views

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
  • 469
8 votes
3 answers
192 views

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
  • 469
4 votes
1 answer
744 views

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
  • 469
2 votes
1 answer
113 views

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
  • 469
4 votes
2 answers
240 views

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
  • 469
4 votes
1 answer
340 views

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
282 views

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
431 views

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
250 views

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
167 views

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

15 30 50 per page
1
2 3 4 5
115