Most active questions

Advice
7 votes
9 replies
209 views

This isn't a joke or a shitpost, I'm being completely serious. I started coding a few years ago and I don't know where to find resources for how to code. Right now I'm working on a messaging app with ...
Samuel Cherry's user avatar
18 votes
1 answer
2k views

I am trying to track if a C++20 coroutine has ever suspended, so that unhandled_exception knows whether it can simply re-throw; the exception back to the caller of the initial coroutine function, or ...
LB--'s user avatar
  • 3,228
0 votes
3 answers
301 views

I am new to C++, I came from Python where there are constructors but no destructors. What is the point of them if the memory is automatically freed when the object goes out of scope ?
Amogus124's user avatar
Best practices
3 votes
9 replies
216 views

In a framework that makes use of the std::int* types (such as std::int16_t) as well as the std::int_fast* types (such as std::int_fast16_t) there could be general rules where one could be better than ...
asimes's user avatar
  • 6,202
Advice
0 votes
6 replies
196 views

I need to layout a structure in two different ways depending on the endianness of the target platform. Currently I'm using an additional pre-compile phase to run a program to test the endianness, and ...
Alnitak's user avatar
  • 341k
Advice
0 votes
4 replies
184 views

Title: Why does GCC transform a >= 4 into a > 3 at -O0? JG seems more complex than JGE I'm analyzing a simple C code on godbolt and found GCC's code generation puzzling: long a; a = a >= 4; ...
Alexandr's user avatar
9 votes
1 answer
607 views

I noticed a discrepancy between C++23 and C++26 code when using googlemock: enum A { A1, A2 }; enum B { B1, B2 }; TEST(...) { ASSERT_EQ(A1, B1); // compiles fine in C++23 and C++26 ASSERT_THAT(...
PiotrNycz's user avatar
  • 25.1k
Advice
0 votes
7 replies
125 views

#!/usr/bin/python import sys,os,math,random,time, json # import everything badly GlobalVar = 0 globalList = [1,2,3,4,5,6,7,8,9,0] class myclass(object): def __init__(Self,Name="bob",age=...
Lee Hoyland's user avatar
9 votes
1 answer
475 views

Consider this code: #include <cstddef> #include <iostream> const double cash = 1000; int main() { size_t my_size_t_value = 2; double my_double_value = -my_size_t_value*...
Joe Chakra's user avatar
11 votes
1 answer
618 views

Consider the following simplified code: template <class T> class Foo { T t; const T* t_ptr; public: constexpr Foo(T t): t(t), t_ptr(&this->t) {} constexpr Foo(const Foo&...
eyelash's user avatar
  • 4,126
3 votes
2 answers
185 views

I've a C++ concept where I need to check that the class has a particular public attribute. My problem is that the concept works if I use it directly, but fails if I use it in std::visit. This is the ...
Jepessen's user avatar
  • 12.7k
Best practices
3 votes
9 replies
130 views

I want to write T::associated_function(..) but sometimes T is too verbose to write, like a long tuple. Is there any way to avoid writing the full T? pub trait Param { fn encode_type(out: &mut ...
mq7's user avatar
  • 1,329
9 votes
1 answer
419 views

How can I get notified when the user minimizes or restores my X11 window? On very old Linux versions I could check for the UnmapNotify message to learn when the window is minimized and MapNotify when ...
Andreas's user avatar
  • 10.5k
4 votes
2 answers
125 views

I need to get a unique ID which I could use as a template argument (which means it must be statically determined at compile-time), for each member function of my class. My first idea was to use the ...
mardy's user avatar
  • 218
0 votes
3 answers
89 views

Okay, this isn't exactly a typical programming situation. I wanna make a pokemon-like homebrew game for the nintendo DS (I know I could use C++, but I only know C so I'm just trying to code in C for ...
Roland Carpenter's user avatar

15 30 50 per page
1
2 3 4 5
123