642 questions
-1
votes
0
answers
44
views
Windows 11: IInitializeWithFile::Initialize Called Multiple Times Causing File Explorer Crash (Works Fine in Windows 10)
I'm developing a Windows Shell Extension that interacts with the File Explorer Preview Pane. The goal is to block file previews under certain conditions for files in a synced folder (like from a cloud ...
0
votes
0
answers
39
views
boost::system::error_code::message() crashed, for it call __cxxabiv1::__cxa_pure_virtual() actually
boost:Version 1.68.0.
os:Linux IVI 5.4.134 #1 SMP PREEMPT Tue Mar 18 01:00:37 CST 2025 aarch64 GNU/Linux.
compiler:gcc7.3.
when I called boost::system::error_code.message() like LOG("open error: %...
0
votes
0
answers
77
views
Is there a compiler optimization that avoids vtables in case there is only one possible set if functions that can be called? [duplicate]
Imagine an interface with only pure virtual functions and imagine also that there is only one class that implements it. This can happen when interfaces are used to hide implementation details in an ...
0
votes
1
answer
83
views
What happens to vtable pointer when upcasting non-pointer object?
I am studying VTable of c++ in university. And maybe I missed something, but I saw following example:
class Parent{
public:
int x;
Parent(int _x) : x(_x){}
virtual void print() const{
...
3
votes
3
answers
169
views
C++ - Trying to understand virtual functions, virtual tables and why does this program seg faults [duplicate]
The following program causes a seg fault.
From printing I saw that no Dtor is called before the crash.
In gdb I saw that each Y object contains a pointer to its vtable.
So when trying to delete an ...
0
votes
1
answer
195
views
how to use ON_CALL and Matcher in gtest with overloaded mocked nfunctions?
I am mocking a class with two overloaded methods like this:
//required because some versions of gtest messes with extra commas in MOCK_METHOD
typedef std::pair<char*, uint32_t> KeyValueType;
...
0
votes
0
answers
113
views
Vuetify, v-data-table-virtual nested scroll bug
I'm trying to implement a virtual data table where when a row is clicked, it shows another embedded data table. However, with the row expanded, when you attempt to scroll the outer table, it gets ...
0
votes
0
answers
31
views
How to determine the cause of a linker error for a derived class [duplicate]
I am unable to decipher a linker error and would like to understand the issue. To provide more context: I have an interface class like below
class ModuleInterface {
public:
virtual ~...
1
vote
0
answers
103
views
C++ 20 modules. duplicate of vtable
Here is the code:
// A.cppm
export module AMOD;
export class A {
public:
virtual ~A() = default;
virtual foo() = 0;
};
// B.cppm
export module BMOD;
import AMOD;
export class B : public A {
...
1
vote
1
answer
84
views
c++ static_cast to virtual base in runtime
Suppose we have such code:
struct Granny {
int g;
};
struct Mom : virtual Granny {
int m;
};
struct Son : Mom {
int s;
};
int main() {
int x;
std::cin >> x;
Mom* mom = (x ? new Son :...
2
votes
1
answer
86
views
Inheritance and Visibility in Swift
I'm confused about the content in the swift doc:
Notice that the initializer for the EquilateralTriangle class has three different steps:
Setting the value of properties that the subclass declares.
...
0
votes
1
answer
98
views
Optimizing calls to derived-class virtual methods from inside of a base-class implementation [duplicate]
Suppose I have an abstract class and derived class like so:
class base {
public:
virtual void pure_func() = 0;
// arbitrary method that makes call(s) to virtual method(s)
virtual void ...
0
votes
1
answer
55
views
Qt6 / Cmake Link error while porting Qt chart example from .pro to cmake. Undefined reference to vtable
For experience, I'm importing chart.cpp and .h from the dynamic spline example (which works perfectly fine on its own) in my own CMake built app. The example is compiled with a .pro file.
I Tuned the ...
0
votes
0
answers
71
views
How swift virtual tables are implemented in case of calling super from subclass
Suppose we have a class and it's subclass. We know that virtual table for second class has methods from superClass with changed addresses for overridden methods, and added methods from subclass is ...
0
votes
1
answer
50
views
Why is dynamic dispatch not working within a template function?
I have the following code. There is a base class (Node) and a derived class (NumberExprNode) that each have a virtual equality method.
#include <vector>
#include <memory>
#include <...