General C++ Programming - July 2023

Updating from enum to enum class causes issues
 
I have a small, in-progress, project specifically chosen to let me explore and learn C++. In this project, I had declared an enum in a global.h file, which con...
[7 replies] Last: The keyword "inline" is misleading in this regard. Is it because inl... (by Ganado)
Need help on Reversing Packets
 
Hello all , I reversing game packets , Everything is good, but how do I save these values in the array or Vector [ValueFromRecv,id,x,y] Note that it is no...
[7 replies] Last: Where possible use .emplace() as this mitigates the requirement to per... (by seeplus)
by jNc
How to declare cv::VideoCapture cap(2) as global variable
 
Trying to declare with extern notation, but failed. C++ chunk to get CV::Mat is below: cv::VideoCapture cap(2); cap.set(cv::CAP_PROP_FRAME_WIDTH, 1920);...
[2 replies] Last: :-1: error: ReadCapture.o:/home/supernova/build-MPU-Desktop-Debug/../D... (by jNc)
by jNc
OpenCV freezing
 
Getting OpenCV Matrix from Macbook/Windows Desktop Using Huawei/Ubuntu and Ezcap 331 and HDMI cable C++ chunk to get CV::Mat is below: cv::VideoCapture c...
[2 replies] Last: already posted there, too! Sorry, I did Edit in the morning, but serve... (by jNc)
Eigen memory management issues
 
I am having some memory performance issues with my Eigen code. For example, using task manager to monitor memory usage I notice that the code uses a lot of memo...
[6 replies] Last: "Segfaults on a read" means your code attempts to read from a memory l... (by mbozzi)
by frek
Code objects alignment, memory and execution by CPU in C++ (1,2)
 
Hi all, I've got some info but would like to know how exactly a C++ code's objects with regard to alignment are stored in memory and then fetched by CPU for ex...
[29 replies] Last: Low level memory allocation is almost never a problem. This^^ wher... (by jonnin)
How to specify the template parameters of a template member of a template class?
 
Consider the following: template<typename T> class Blob { public: template<typename It> Blob(It b, It e) : data(std::make_shared<std::vector<T>>(b,e...
[4 replies] Last: that's what I was fearing!! Thank you!! (by JUANDENT)
Why does this function not deduce template arguments?
 
I have a template function like this: template <typename T, template <typename> typename Container> void sortContainer(Container<T>& cont) { std::sort...
[2 replies] Last: thank you!! (by JUANDENT)
by Atom1
C++ Exception
 
I run two applications, Tradestation and Ninjatrader. Ninjatrader provides a managed .Net dll to allow other applications to communicate with it. We built a sec...
[8 replies] Last: I think we finally have come to an end. The last problem was just some... (by Atom1)
  Archived months: [jun2023] [aug2023]

This is an archived page. To post a new message, go to the current page.