derived Questions

4

Solved

I'm using a vector of pointers to objects. These objects are derived from a base class, and are being dynamically allocated and stored. For example, I have something like: vector<Enemy*> En...
Bluepoint asked 1/9, 2009 at 7:58

2

Solved

I am confused about the differences between redefining and overriding functions in derived classes. I know that - In C++, redefined functions are statically bound and overridden functions are dyn...
Juniejunieta asked 4/11, 2014 at 20:3

2

Solved

This is regarding Xcode 9.2. I added a framework (local Git repo) to my project, then deleted it when it did not do what I needed it to do. Now when I do a commit there is a popup with the old GIT ...
Toronto asked 25/1, 2018 at 23:34

1

Solved

I am trying to generate encoders and decoders for two case classes: object EventBusCases { case class ValuationRequest(function: RequestValue = ALL_DAY_VALS, interval: RequestValue = IntraDayInte...
Catalectic asked 3/2, 2020 at 16:21

3

Solved

I am using ANTLR to generate Java source files. I can make Eclipse understand the generated files are derived, but it still gives me warnings about harmless things (e.g. unnecessary imports and so ...
Stanislas asked 24/11, 2009 at 21:24

10

Solved

Suppose I have BaseClass with public methods A and B, and I create DerivedClass through inheritance. e.g. public DerivedClass : BaseClass {} Now I want to develop a method C in DerivedClass tha...
Carbuncle asked 19/9, 2008 at 23:29

2

Solved

According to C++ Singleton design pattern I wrote a singleton template template <typename T> class Singleton { public: static T& getInstance() { static T instance; return inst...
Modest asked 26/12, 2016 at 7:44

2

Solved

I'm having some trouble trying to implement a custom stream class to generate nicely indented code in an output file. I've searched online extensively but there doesn't seem to be a consensus on th...
Henkel asked 12/12, 2012 at 15:10

5

Solved

I am trying to get the derived type of an object via a base class virtual function. I have written this, which does not compile: struct base { virtual base& get_this() { return *this; } }; ...
Glossary asked 21/10, 2013 at 18:20

3

Solved

I've read through loads of similar questions but haven't found the answer. I'm using Visual Studio 2010 and boost 1.47. Here's the code, it's complete and compilable: #include "stdafx.h" #inclu...
Glassworker asked 15/3, 2012 at 10:41

4

Solved

I am trying to understand the following code. Derived is a derived structure from T and what does "," means and then Fallback {} template <class T> struct has_FlowTraits<T, true> { st...
Novitiate asked 26/12, 2012 at 12:49

2

Solved

I've had some second thoughts on multiple virtual destructors, esp. after reading reading http://blogs.msdn.com/b/oldnewthing/archive/2004/05/07/127826.aspx . Suppose I have class Base { publ...
Pithy asked 17/11, 2012 at 0:25

4

Solved

I have a Maven Java project, imported using m2eclipse. The target/ directory is not marked as 'Derived' by m2eclipse. Problems: It is validated, so any validation error appear twice. My exampl...
Weintraub asked 2/11, 2009 at 15:52

1

Solved

Hi all I have a base class called Vehicle and I have all the properties common to all vehicles in there and I have multiple derived classes called Car, Jeep which derive from Vehicle and add more p...
Diphosgene asked 4/5, 2012 at 21:54

3

Solved

Can someone explain why the result of the code below would be "class B::1" ? Why does the virtual method of derived class uses the default parameter of a base class and not his own? For me this i...
Cheroot asked 3/6, 2012 at 15:7

3

Solved

I have a virtual base method void Action() that is overridden in a derived class. The first step in Action is to call base.Action(). If a situation occurs in the base method I do not want the rest...
Caridadcarie asked 28/5, 2012 at 9:4

4

What is the most elegant way to provide an interface in C++ that accepts derived class types that carry with them different data type members that then need to be retrieved later. The example below...
Xylotomy asked 4/1, 2012 at 21:45

5

Solved

I have a base class and a derived class as bellow public class animal { public string name { get; set; } } public class dog : animal { public int age { get; set; } public string type { get; se...
Ebracteate asked 16/12, 2011 at 3:5

2

Solved

I want to define a type name in a templated class that I can use elsewhere to refer to the type of a member in the class. template <class T> class CA { public: //typedef typename T::iterato...
Unattended asked 12/12, 2011 at 9:52

3

Solved

My problem in brief: class A { /* Other stuff in my class*/ protected static staticMember; } class B : A { /* Other stuff in my class*/ // Will have A.staticMember but I want B.staticMember (...
Pleuro asked 21/11, 2009 at 18:54

1

Solved

I have this trigger : CREATE trigger [dbo].[DeriveTheAge] on [dbo].[Student] after insert,update as begin declare @sid as int; declare @sdate as date; select @sid= [Student ID] from inserted; ...
Faint asked 5/9, 2011 at 16:49

2

Solved

I have a program where I need to make a base class which is shared between a dll and some application code. Then I have two different derived classes, one in the dll one in the main application. Ea...
Caveman asked 5/9, 2011 at 11:12

2

There seems to be no good online documentation on this: If I make a derived class, will it automatically have all the attributes of the base class? But what's the BaseClass.__init() for, do you als...
Overspend asked 18/6, 2011 at 13:45

6

Solved

I have four classes. Request, DerivedRequest, Handler, DerivedHandler. The Handler class has a property with the following declaration: public abstract Request request { get; set; } The DerivedH...
Ulcer asked 14/6, 2011 at 22:42

3

Solved

I'm having a problem in C++ with calling a function of a derived class while having a pointer to the base class. EDIT: Some answers referred me to CRTP but my point is that I need to have a point...
Nureyev asked 17/5, 2011 at 5:44

© 2022 - 2024 — McMap. All rights reserved.