|
by: Erik Bongers |
last post by:
Hi,
Nested classes only seem to be able to access static members of the
surrounding class :
class SurroundingClass
{
public:
class InnerClass
{
public:
|
by: Rubén Campos |
last post by:
Organizing classes, types, structures, enums and whatever other entities
into nested namespaces requires to include into every header and
implementation file the complete path of namespaces. Let me show an example:
classes.hpp classes.cpp util.hpp util.cpp main.cpp
// classes.hpp
namespace Classes
{
class MyBaseClass
{
|
by: B0nj |
last post by:
I've got a class in which I want to implement a property
that operates like an indexer, for the various colors
associated with the class.
For instance, I want to be able to do 'set' operations like
MyClass.MyColors = Color.Green
or, a 'get', such as
Color forecolor = MyClass.MyColors;
I want to use an indexer so I can take parameters, such
as the color type (e.g. "Foreground", "Background" etc.).
With a single member function I couldn't...
|
by: Robert W. |
last post by:
I've almost completed building a Model-View-Controller but have run into a
snag. When an event is fired on a form control I want to automatically
updated the "connnected" property in the Model. This works fine if all of
the properties are at the top (root level) of the model but I'd like to keep
them in nested classes to organize them better.
So, for example, part of my data model looks like this (simplified) :
public class MainClass
|
by: Bob Day |
last post by:
Using VS2003, VB.NET, MSDE...
I am looking at a demo program that, to my surprise, has nested classes,
such as the example below. I guess it surprised me becuase you cannot have
nested subs, and I am not sure why you would want nested classes anyway.
Is there a URL that explains the advantages to nested classes, when they
would be used, etc? What are your thoughts?
Also, if a Class has nothing before it (i.e. no Public or Private,...
|
|
by: miked |
last post by:
I am architecting in a read only class for use in mapping data to a business
object. The object makes strong use of nested classes and their ability to
access protected fields. The downside is when a nested class inherits from
it’s parent class you get this infinite class chain in intellisense when
consuming the class. To get around this I created two child classes Reader
and Writer which require a base Person object.
When consuming...
|
by: Jake K |
last post by:
What purpose does nesting a class inside another class typically server?
Are there conditions where this would be beneficial? Thanks a lot.
|
by: Cousson, Benoit |
last post by:
I don't think so; my original email was mainly a question. I do agree that they are other ways to do what I'm trying to achieve; there are always several ways to solve an issue.
Few days ago, I decided to use nested class because I realized that it was the most convenient way to implement my need.
Since this feature is supported in many languages, I was just surprised that Python did support it only partially, hence my original email.
...
|
by: Maric Michaud |
last post by:
Le Tuesday 12 August 2008 23:15:23 Calvin Spealman, vous avez écrit :
I was not aware of any "nested classes are unsupported" before and didn't
consider nested classes as bad practice till now, even with the pickle
limitation (not every class are intended to be pickled), more you didn't give
any evidence or any pertinent quote of this and at least one of Guido in the
above threads seems contradict you :...
|
by: card |
last post by:
Hi everyone,
I have a question about referencing a nested class contained within a templated class. Of course the best way to show you is by example. Here's my templated classes:
#include <stack>
template <class T>
class A
{
public:
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|