python (65.2k questions)
javascript (44.3k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (13k questions)
Get class member from next member's address
I'm wrapping a C interface and require to pass into it the address of a preallocated buffer. My wrapper places this buffer at a known location within wrapper object A. At runtime, I will be able to qu...
glades
Votes: 0
Answers: 0
pointer type dependent on if else conditional
Currently, I have code that looks like below:
template <class T>
void func(const Tensor& input) {
T* ptr = input.get_ptr();
// we do some stuff with ptr below
}
I want to change the c...
roulette01
Votes: 0
Answers: 0
Understanding UB and pointer-arithmetic
I have a generic reference-counted heap-allocated wrapper class. So my class is basically just a pointer:
template <typename T>
class Refcounted {
struct model {
std::atomic<std:...
Ben
Votes: 0
Answers: 0