Skip to main content
Stack Overflow
  1. About
  2. For Teams
Filter by
Sorted by
Tagged with
0 votes
0 answers
55 views

My code is below: class GrandParent { public: GrandParent() {} virtual ~GrandParent() {} int grandparent_data = 100; }; class Parent1 : virtual public GrandParent { public: Parent1() {}...
15 votes
2 answers
811 views

I'm encountering unexpected behavior on MSVC when storing a pointer to a virtual method in a static inline variable. The issue does not occur on GCC or Clang. Specifically, when I store a pointer to a ...
2 votes
0 answers
142 views

If a derived class Sub overrides a virtual method foo from the base class, and there is no chance to invoke it during the brief phases of construction/destruction when the type of the partially ...
0 votes
0 answers
64 views

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
1 answer
98 views

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{ ...
dohyunii's user avatar
3 votes
3 answers
188 views

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
474 views

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
179 views

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

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 ~...
bourne's user avatar
  • 1,259
1 vote
0 answers
122 views

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
97 views

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
111 views

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
104 views

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 ...
Cartier's user avatar
  • 425
0 votes
1 answer
70 views

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 ...
Julien's user avatar
  • 890
0 votes
1 answer
67 views

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 <...

15 30 50 per page
1
2 3 4 5
...
43

AltStyle によって変換されたページ (->オリジナル) /