Questions tagged [c++]

C++ is a general-purpose programming language. It was originally designed as an extension to C and has a similar syntax, but it is now a completely different language. Use this tag for questions about code (to be) compiled with a C++ compiler. Use a version-specific tag for questions related to a specific standard revision [C++11], [C++14], [C++17], [C++20] or [C++23], etc.

1
vote
0answers
29 views

How reliable is the format of demangled names?

I am working on a pretty dynamic C++ program which allows the user to define their own data structures which are then serialized in an output HDF5 data file. Instead of requiring the user to define a ...
0
votes
1answer
25 views

std::max with overloaded less operator doesn't compile

Here's the code: #include <iostream> #include <fstream> #include <string> #include <algorithm> #include <utility> struct student { std::string full_name; int ...
0
votes
0answers
9 views

EVP_PKEY_CTX_new_id returns NULL openssl 1.1.1g

I am using openssl 1.1.1g to implement parts of the quic RFC. I followed the suggestions in the following link How to use OpenSSL 1.1.1 to implement HDF-Extract? But the very first call (...
1
vote
0answers
15 views

I can compile with g++ but get a buggy program with equivalent cmake (GTK error)

I have a very simple program in main.cpp that displays an image with openCV. I compile it using the following command: g++ -o main main.cpp $(pkg-config opencv4 --cflags --libs) where the output of ...
1
vote
2answers
33 views

deduced return type depedent on member function template argument

I am trying to figure out what's wrong with this code: #include <string> struct Bar { using Deduced = typename std::string; }; class Test { template<typename Foo> auto Func() ...
0
votes
0answers
5 views

DirectX) Difference between the buffer and texture

Many people say DirectX has two kinds of resources: Buffer and Texture In the MSDN document, it says that A buffer is a collection of raw data (elements); a texture is a collection of texels (texture ...
0
votes
0answers
22 views

Copy/move elision in case of delegating to a copy/move constructor

In the following program, the constructor A::A(int) delegates the call to copy/move constructor, which both are explicitly deleted: struct A; A f(); struct A { A() {} A(int) : A(f()) {} A(...
0
votes
1answer
40 views

Interfaces in cpp

As you will soon see, I am not a c++ developer and for this problem I am working on c++ is my only option. I don't mind learning, so just some guidance would be appreciated. I have a panel class as ...
0
votes
1answer
26 views

candidate template ignored: could not match 'function<type-parameter-0-0 ()>' against 'double (*)()'

I am trying to use a template that takes in an std::function, but the template argument deduction is failing. double foo(){ return 2.3; } template <typename V> void funcC (V (*fptr)()){ std:...
0
votes
1answer
42 views

Could you write a printf wrapper that interleaves formatting code and arguments?

I like the succinct format specifiers that printf offers such as %1.3f, as compared to cout, but hate how you have to put all the variables you are going to print at the end of the argument list, ...
-1
votes
0answers
39 views

Size of int pointer [duplicate]

I checked the size of an int pointer as follows: #include <iostream> using namespace std; int main() { int temp [10]; int *ptr=&temp[0]; cout<<sizeof(ptr)<<endl; } ...
-1
votes
0answers
26 views

How do I go over to the next line while reading a file c++ [duplicate]

I have this text in a Data.txt that I want to read in my cpp file in order to create an saving account object and add it to vector of accounts: 24464 Isaias 1 200 nu qu zi 5 SAVING 4827 Israel 1 400 ...
0
votes
0answers
35 views

The function of std::void_t in member detection [duplicate]

An example demonstrated in this std::void_t reference is to detect if a specified type has a member type named type: // primary template handles types that have no nested ::type member: template< ...
0
votes
0answers
13 views

Catch error LNK2019 unresolved external symbol "" referenced in function [duplicate]

I got such error with the message: TestBufferQueue.obj : error LNK2019: unresolved external symbol "void __cdecl GenerateAndEnqueueItems<class QueueItem,15>(int,class common::bufferqueue&...
0
votes
0answers
14 views

Issue with reading an image stored in .raw format using pointer for OnnxRuntime Inference

I was trying to run a OnnxRuntime Inference on a image file of jpg format using a pretrained Squeezenet model as illustrated in the blog: https://leimao.github.io/blog/ONNX-Runtime-CPP-Inference/ ...

15 30 50 per page
1
2 3 4 5
50133