Category "c++"

PyTorch - Using {N,H,W,C} format in customized operation

I'm thinking about upgrading some of my customized PyTorch operations to support {N,H,W,C} format. However, I'm still confused about using channel-last-format t

Why hasn't not_null made it into the C++ standard yet?

After adding the comment "// not null" to a raw pointer for the Nth time I wondered once again whatever happened to the not_null template. The C++ core guidelin

Why don't we have to declare static functions the same way we need to declare static variables in c++?

Consider the following struct: struct Toto { static int a; static void Print() { std::cout << a; } }; And the following main functio

Attempting to solve this problem more efficiently

I read a natural number with at most 9 digits. I have to form a vector with the even digits of that number, in ascending order, with each digit appearing once (

How to show cursor during application debug c OpenGl on ubuntu in Visual Studio Code

window = glfwCreateWindow(winW, winH, "TestApp", NULL, NULL); After calling this command, the mouse cursor disappears. When a breakpoint is triggered after thi

Can I mix C++ and Swift in the same swift package, using the Swift Package Manager?

I would like to write one module in C++, and make some functions in C that are accessible in Swift. I am somewhat baffled, because no matter what I do, the SPM

Question about the declaration about the aliasing constructor for `std::shared_ptr`

I think the 8th constructor of the std::shared_ptr<T> should be decalared as template< class T, class Y > shared_ptr<T>( const shared_ptr<Y

Google breakpad on arm64. Symbols not found in minidump

I'm building my application and source code of breakpad on Ubuntu 20.04 with two architectures (arm64 and x86_64). Both have been built on Mac with M1 inside do

Weight implementation in graph

I am trying to find the path between two vertices and their distance. My implementation is the following: #include <iostream> #include <list> #inclu

errors whan using QTimer in a multithreading application

I am starting a api rest server in a separate Qthread in my application. the server shall use a library which is using Q timer in several places. The compilati

Binding Callback Function to a HeaderTemplate

How do I bind a callback function to a DataTemplate inside a HeaderTemplate in WinUI3? After reading various answers it appears the DataContext inside a HeaderT

Memory leak issue virtual camera macOS, swift SwiftUI zoom caphost

We are developing a application with virtual camera plugin for macOS by using swiftUI & swift. It has also C++ & objective C library. When we use that p

C++ map with constructor and parameter

I want to have an unordered map with a string and a std::function that call a constructor a class to make a shared_ptr. But I'm stuck, I don't know what I shoul

BOOST request sending JSON data

I want to transfer json data into request of json boost in cpp. If i take json in boost int outer=2; value data = { {"dia",outer}, {"sleep_tim

Bug in Microsoft x64 compiler for signed/unsigned mismatch warnings?

Consider this piece of code: #include <iostream> #include <vector> #include <cstdint> int main() { std::vector<int> a{ 10, 11, 12, 13

Accumulating Doubles Into Bins via intrinsics

I have a vector of observations and an equal length vector of offsets assigning observations to a set of bins. The value of each bin should be the sum of all ob

Unresolved External Symbol - FMT

This is a strange error, because it only happens with this function: #define FMT_HEADER_ONLY #include <fmt/os.h> #include <fmt/format.h> #include &l

How would I propose a new, non-library feature for possible standardization in ISO C++? [duplicate]

I have some ideas about features that would be useful to have in C++. I would like to propose these features to the applicable ISO committee(s

C++, initialize a 2d array. error:subscript requires array or pointer

New to C++. Here is my code: #include <string> #include <cstdlib> #include <time.h> using namespace std; const int Gardensize = 20;//Garden

Can lambda be used instead of void operator?

I'm wondering about this c++11 example and using operator for algorithm functions (for_each, remove_if etc.). For example, I have 2 blocks: struct UpdateFunc {