Category "c++"

Why is Windows Defender scanning my code?

I am compiling C++ code using Visual Studio 2019. The code ranges from simple projects to learn C++ features to game dev. But no matter the scope of the project

alignof(T) with T=__m512 is not equal to alignof(__m512)

I ran into a strange situation that alignof(__m512) is not equal to std::alignment_of<__m512>::value compiled by Apple's clang. After some testing I found

Making a namespace a friend of a class?

I'm trying to encapsulate the Allegro5 C++ library and I want to have a namespace of rendering functions. The problem is that in order to use the rendering func

multithreaded C++ read access violation 0XCDCDCDCD

I'm writing a simple multithreaded md5 hash cracker using a task farm, except i keep getting read access violations seemingly at random. heres the function the

Macro doesn't handle bool conditions when they are "inline" but works via variable

I've written a basic macro which asserts regardless of debug or not: #define ASSERT_ALWAYS(cond) \ do \ { \

no NPOT issues on msvc but when on mingw-w64 the screen stays blank

I'm using olc::PixelGameEngine and I'm using the Example Program except that I'm enabling STB image. on MSVC, PGE worked great for several months without any is

O(n) and time complexity function of the given code

If the following loop structure is under Analysis of Upper bound, does it still compute to O(n^2)? I'm confused since inner loop has a dependency on the outer l

How to print a n-dimensional c++ STL container? Container is array of arrays or vectors of vectors

I have a code where I want to display tensor represented as vectors of vectors or std::arrays of std::arrays. The intention is to print them the way numpy print

Visible order of operations with acquire/release fence in C++

I have a following program which uses std::atomic_thread_fences: int data1 = 0; std::atomic<int> data2 = 0; std::atomic<int> state; int main() {

How to call a mvsc dll (C++ or Rust) from Progress Open Edge

I have a dll that i want to call from Progress code but I can't complete. I have tried with Visual Studio 2022, Windows C++ Dll and Rust Dll. Windows C++, Visua

Deribit FIX API Logon

Following code doesn't seem to work to Logon using FIX API. Getting "invalid credentials" from the exchange though same username and access key seem to work wit

Narrowing conversion on a (int64_t * static_cast<float>(double))

I'm fixing some lint errors in a codebase I am working with, and I see the following line // note offset is int64_t, scale is int64_t, x is double int64_t y = o

error: new initializer expression list treated as compound expression [-fpermissive]

I am trying to write a playlist method for songs in c++, however, I keep running into frequent errors. template <typename T> struct cir_list_node {

Counting how many decision variables are equal

I'm a beginner user of Google OR-Tools, especially the CP-SAT. I'm using version 9.3, and I'm interested in the C++ version. I'm modeling a problem where I need

C++ Vector returning odd output for last iteration?

I am attempting to figure out the Skyline problem to better understand C++, right now I am learning more about how I can use vectors. I am trying to iterate thr

How to test a singleton generic template to be thread safe?

How do I make Singleton generic template, and how can I test it? Right now I am interested in seeing with my own eyes that 2 threads that invoke get_instance()

MQTT message is not received because of object in object

Libraries: <PubSubClient.h> <ESP8266WiFi.h> "ArduinoJson.h" When I send this JSON, the message is received and I can do things with it: {"topic":"d

MulVAL: make[1]: *** [Makefile:4: attack_graph] Error 1

I'm trying to compile MulVal, everything is already setup tried all of the solutions, getting this error, don't know if it was from the compiler or the code it

Garry's Mod: How to send a DLL?

Garry's Mod provides a C++ API to create server-side and client-side DLLs. As it is said in the article "Creating Binary Modules", they must be placed in the "g

How to make this code faster in python (algorithm question)

Today I was browsing for some questions that I saw this: Algorithm - Air Battle C ++ time limit: 1 second Java time limit: 2 seconds Python time limit: 10 secon