Category "inheritance"

Deleting a pointer from a vector... Error: terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc

I'm getting the error after I delete a pointer from the vector and try to delete a second one. I'm still new to pointers I created a base class of shapes and ha

What is the reason for the lack of inheritance of text-decoration? [closed]

So I've read the previous disccussion on this topic and I understand that text-decoration is propagated instead of inherited, but the spec doe

Dart abstract factory method

I'm pulling table data from api in my application that I wrote with Flutter. According to the API used in the table data, different types of data are coming. I

Column Inheritance for Independent ORM Mapper Classes In SQL Alchemy

I am trying to replicate the following SQLite CREATE TABLE statements using the declarative ORM mapper classes in SQLALchemy. CREATE TABLE IF NOT EXISTS questio

Architecture of sub-classes in C++

I learn C++ OOP-paradigm and want to ask related question: Assumption We have a base class: class Base { public: virtual SomeType PowerMethod() { return So

Python generic that adds typed functionality to extend existing types incorrectly typed

I am interested in creating a generic to add a fixed functionality to different types in python. I have a semi working solution, but it's tying is problematic.

wrap inherited classes in Python

Let's say I have a number of inherited classes class Bird: def __init__(self): pass def identify(self): print("I am a generic bird!")

Python exception type object inheritance

I need to retrieve the name of the object in which an error has occured. The error is catched in a try exception statement. The error type as returned by err_ty

Inheritance and std::shared_ptr in Cython

Suppose I have the following simple example of C++ inheritance in file.h: class Base {}; class Derived : public Base {}; Then, the following code compiles; tha

Virtual Method not calling derived class method (only calling base class) C++

My base class detect() and collect() methods are the only ones being called. I'm trying to get the derived class methods of these to be printed instead. I belie

how to define deep copy of subclass if super class has customized deep copy

My super class A has a method copy(), which is a customized deep copy function. The sub class B wants to inherit this deep-copy function while also deep-copying

R R6 Inheritance with roxygen2 - class "ParentClass" is not exported by 'namespace:ParentPackage'

I am running into an issue with R6 inheritance. I am writing 2 packages (work related so I have to use fake code but I'll try to keep it accurate). In ParentPac

JPA Inheritance with JOINED strategy

I've seen many posts about inheritance but nothing match my problem. I try to build a correct objects model: The root class @Entity @Inheritance(strategy = I

Why do we need to typecast the WebDriver instance to JavascriptExecutor before calling the executeScript method?

JavascriptExecutor is an interface which provides some default code for executeScript method. RemoteWebDriver implements this interface and overrides the method

What exactly does super() return in Python 3? [duplicate]

From Python3's documentation super() "returns a proxy object that delegates method calls to a parent or sibling class of type." What does that

Python: overloading the `__call__` dunder method of a class that inherits Enum

Consider the following: from enum import Enum class A(int, Enum): def __new__(cls, value): def call(cls, value): print("HELLO 1" +

Flutter: List inheritance in classes

Hello guys I am new on flutter and building a new app... I have a problem that I cannot do it... I want to call elements of List from another class, I wrote so

How to correctly inherit Unity's callback functions like Awake(), Start() and Update and FixedUpdate()?

I've created a parent class that I expect to have all functions related to testing if the GameObject is grounded, in water, on air, etc... given that this funct

AttributeError: 'super' object has no attribute 'word_weighting'

I have a super class FTM: class FTM: def __init__(self,word_weighting = 'normal'): self.word_weighting = word_weighting def get_sparse_glob

Python circular imports with inheritance

I have a parent and child class, where a parent's method returns an instance of the child. Both classes are in separate files classA.py and classB.py. In order