Skip to main content

Questions tagged [c++]

C++ is a statically typed, free-form, multi-paradigm, compiled, general-purpose programming language. This tag should be used for any question which requires knowledge or expertise with the C++ programming language. This is a general tag which is used for any of the C++ language standards (C++98, C++11, C++17, etc.). The question should identify the compiler being used, the operating system, and which of the C++ standards is being targeted.

6 votes
1 answer
320 views

Implementing a mutex-free thread safe scheme for protecting a object

I've written a MQTT client for embedded system with RTOS (understand not POSIX, generally FreeRTOS). There's no pthread in the system. There's only 32 bits atomic instructions supported. The client ...
xryl669's user avatar
  • 163
10 votes
2 answers
392 views

Image Stitching using SIFT Keypoint Descriptor in C++

This is a follow-up question for SIFT Keypoint Detection for Image in C++. With the detected SIFT keypoints of images, image stitching is possible to perform. In this post, the first step is to ...
JimmyHu's user avatar
  • 7,535
4 votes
2 answers
139 views

Lookahead match

I need to write code that contains a lot of checks for sequences in a list of the form: ...
adrianton3's user avatar
11 votes
4 answers
1k views

C++ lock free single linked list dedicated to word frequency

I'm building this code for my students, so I'd like any comments about modern C++ and whether it is pedagogic. And of course if you find any logic error. Basic exercise is to count word frequency in a ...
Yann TM's user avatar
  • 243
4 votes
2 answers
600 views

Reference counted smart pointer with concept

I wrote a simple reference counted smart pointer. The reference count is supposed to be inside the object it owns (not the smart ptr itself, like std::shared_ptr) ...
Raildex's user avatar
  • 283
2 votes
2 answers
172 views

Affect a repetition of an argument N times (for array construction)

Consider the following (C++20) function (from the solution to this StackOverflow question): ...
einpoklum's user avatar
  • 2,099
2 votes
1 answer
83 views

RAII Wrapper For CUDA Pointers

I was recently working on my CUDA wrappers library, and this particular class is one of the oldest pieces of code in the entire project. Since that time, I added tons of other features (for example <...
NeKon's user avatar
  • 641
4 votes
0 answers
95 views

Integration Test for Polymorphic data models that save data to MySQL

As noted by @TobySpeight in his answer to Polymorphic data models that save data to MySQL and restore data from MySQL the test code should also be reviewed. His ...
pacmaninbw's user avatar
  • 26.1k
12 votes
1 answer
783 views

Strongly-typed CUDA device memory

When I discovered that CUDA device memory was represented by plain old void* I was horrified by having to deal with C-style type safety and resource ownership (i.e. ...
Toby Speight's user avatar
  • 88.3k
4 votes
2 answers
123 views

Polymorphic data models that save data to MySQL and restore data from MySQL

This is a follow up question to Inserting and retrieving data MySql Database access in C++ using Boost::ASIO and Boost::MySQL. I have reduced the amount of code to be reviewed by presenting only one ...
pacmaninbw's user avatar
  • 26.1k
8 votes
2 answers
295 views

Implementation of a kd-tree header-only library

I've took inspiration from https://www.geeksforgeeks.org/cpp/kd-trees-in-cpp/ and implemented a kdtree library and I would like to get a review of it. The main target was to have a kd-tree ...
Pangi's user avatar
  • 370
8 votes
4 answers
1k views

Memory mapped file interface for linux

I am working on a game engine that should read (among others) compressed files and decompress them into memory. Where the compressed file should be memory mapped. For that I implemented a simple ...
Raildex's user avatar
  • 283
2 votes
1 answer
123 views

A Tic-Tac-Toe prototype written in SFML and C++

I'm a beginner in C++, and I tried to implement some basic skeleton for a game of Tic-Tac-Toe using SFML 3.0.0. The thing is, it contains some main logic: Place figures (...
Zendorr's user avatar
  • 23
10 votes
3 answers
936 views

Checking for string isomorphism in C++

Intro This snippet is a translation of the Java version. Code string_util.hpp: ...
coderodde's user avatar
  • 31.9k
7 votes
1 answer
875 views

Move generation in my C++ chess engine [closed]

I am building a chess engine in C++ and currently working on the move generation. To measure performance I use perft, but my main goal is to make the move generator itself faster. I already use ...
Viliam Holly's user avatar

15 30 50 per page
1
2 3 4 5
652