Category "c++"

Manually building C++ library in bazel (4.2.1) sandbox

For a proof on concept I want to use a CMAKE library in a large bazel (4.2.1) project. In my first attempt I build the library outside bazel by hand and am load

opencv 3.1.0 imread stunked, but imdecode is ok

I'm using opencv 3.1.0, tried to read an image by imread, just like Mat image = cv::imread("1.jpg"); but it stunked without any error message (performs like in

C++ redefinition of function

I have a base class and 3 separate derived classes. All of the .hpp files are structured the same. The .hpp which doesn't work: #ifndef CAESARCIPHER_HPP #define

Can't compile Bitcoin Core, because Boost library for C++ gives error when compiling

So, was trying to compile Bitcoin Core from source. I configured and downloaded all the dependencies I needed. But when compiling, Boost library for C++ gives w

Is there a way to find exact location ( adress ) of file on disk?

I'm developing a software using C++ for Windows/Linux. I want to create a file (txt, json, license, you name it) at runtime, and save it somewhere. Is it possib

Explicit template instantiation for a range of template parameters in C++

Explicit template instantiation is very useful when creating libraries. Suppose I have a template with an int paramater: template <int i> struct S { ... }

How do I translate this simple OpenACC code to SYCL?

I have this code: #pragma acc kernels #pragma acc loop seq for(i=0; i<bands; i++) { mean=0; #pragma acc loop seq for(j=0; j<N; j++) m

Why is the built-in array subscript can be an lvalue?

Indicate in cppreference that the expression representing the subscript must be a prvalue of unscoped enumeration or integral type. So why can a for loop that

Looking for the correct Qt5 mechanism to create an identical sized QGridLayout using a custom widget in the grid

So,I'm trying to build a small app that watches my MQTT server for messages and presents a widget with the MQTT JSON content for every message it sees. The logi

How do i use a dynamic array with char type

So try to write a program that allows the user to range the number of rows in the program. I was unable to figure out how I was able to do so using a char array

Explicitly calling base class constructor in derived class

May I ask if we are allowed to explicitly call base class constructor in derived class? (if not, why?) I'm asking this question because I wrote the following to

Linking python and c++ on windows

I'm trying to create a python library, written in c++, using boost-python, and mingw to compile. c++ Code: char const* greet() { return "hello, world"; } #i

confusion with cppyy for overloaded methods and error handling

I have a c++ class with several constructors: MyClass(const std::string& configfilename); MyClass(const MyClass& other); I have python bindings for thi

Pass reference to function that takes `std::unique_ptr`

I have a reference to my object of type MyType, but I need to call a function, say myFunction that takes a std::unique_ptr<MyType>. What is the correct wa

Boost.beast : how to return json response only

code : https://gist.github.com/Naseefabu/173c928603e564879683ccdf10d9d0f8 When i run this and print the response to the console: Sending GET /api/v3/time HTTP/1

Getting index of unique elements in a vector

Is there any STL/Boost function in C++ that allows me to find the indices of all unique elements in a vector? I have seen many solutons to find unique elements,

Raytracing program fails to detect intersections in c++

I am working on a simple raytracer in c++. I am currently implementing an intersection function but have encountered some issues. For some reason, the collision

Unique_ptr in a class

The Human class turned out to be non-copied, since it contains a field of type unique_ptr, for which the copy constructor and the copying assignment operator ha

Segmentation Fault - unordered_map(tarjan's algorithm)

I have implemented Tarjan's algorithm to find strongly connected component in a graph and getting Segmentation fault for some large input. #include <iostream

why do i getting boost.URL linking error?

This is my project : https://github.com/Naseefabu/HFTBOT/blob/master/src/main.cpp When i try to build it, Error : https://gist.github.com/Naseefabu/5a114956f39b