473,395 Members | 1,464 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Making base class non-inheritable

Hi,

Can any one write me how to create a class which cannot be
inherited by any other calls.

example :

Class base{

};

class derived{

};

so here class Base should not get inherited to derived calss. How can
this be done?
Any work around available in C++??

Rgrds
Indra

Jun 22 '06 #1
6 4032

"Indraseena" <mu**********@gmail.com> wrote in message
news:11**********************@p79g2000cwp.googlegr oups.com...
Hi,

Can any one write me how to create a class which cannot be
inherited by any other calls.

example :

Class base{

};

class derived{

};

so here class Base should not get inherited to derived calss. How can
this be done?
Any work around available in C++??


See:
http://www.parashift.com/c++-faq-lit...html#faq-23.11

Regards,
Sumit.
--
Sumit Rajan <su*********@gmail.com>
Jun 22 '06 #2
Hi,

Thankyou very much for your reflex reply.

Thankyou & regards
Murali
Sumit Rajan wrote:
"Indraseena" <mu**********@gmail.com> wrote in message
news:11**********************@p79g2000cwp.googlegr oups.com...
Hi,

Can any one write me how to create a class which cannot be
inherited by any other calls.

example :

Class base{

};

class derived{

};

so here class Base should not get inherited to derived calss. How can
this be done?
Any work around available in C++??


See:
http://www.parashift.com/c++-faq-lit...html#faq-23.11

Regards,
Sumit.
--
Sumit Rajan <su*********@gmail.com>


Jun 22 '06 #3
Indraseena wrote:
Hi,
Sumit Rajan wrote:
"Indraseena" <mu**********@gmail.com> wrote in message
news:11**********************@p79g2000cwp.googlegr oups.com...
Hi,

Can any one write me how to create a class which cannot be
inherited by any other calls.

example :

Class base{

};

class derived{

};

so here class Base should not get inherited to derived calss. How can
this be done?
Any work around available in C++??
See:
http://www.parashift.com/c++-faq-lit...html#faq-23.11


Thankyou very much for your reflex reply.

Thankyou & regards
Murali


1. Please don't top-post.
http://www.parashift.com/c++-faq-lit...t.html#faq-5.4

2. He did answer your question. He told you exactly where to find it,
and he followed the recommendations in the FAQ:
http://www.parashift.com/c++-faq-lit...t.html#faq-5.5

So don't get nasty about a "reflex" reply.
Jun 22 '06 #4
>>> "Indraseena" <mu**********@gmail.com> wrote in message
news:11**********************@p79g2000cwp.googlegr oups.com...
Can any one write me how to create a class which cannot be
inherited by any other calls.
Sumit Rajan wrote:
See:
http://www.parashift.com/c++-faq-lit...html#faq-23.11
Indraseena wrote:
Thankyou very much for your reflex reply.

red floyd <no*****@here.dude> wrote: 2. He did answer your question. He told you exactly where to find it,
and he followed the recommendations in the FAQ:
http://www.parashift.com/c++-faq-lit...t.html#faq-5.5

So don't get nasty about a "reflex" reply.


I didn't see his post as being nasty. Maybe he meant "reflex" to mean
quick and speedy.

--
Marcus Kwok
Replace 'invalid' with 'net' to reply
Jun 22 '06 #5
Indraseena wrote:
Hi,

Thankyou very much for your reflex reply.


Please don't top-post. See item 4 of the FAQ entry below:

<http://www.parashift.com/c++-faq-lite/how-to-post.html#faq-5.4>

Brian
Jun 22 '06 #6
Hi,

I meant to say very quick and fast reply. Please dont take me in
other way.

Thanks & Regards
Murali
Marcus Kwok wrote:
"Indraseena" <mu**********@gmail.com> wrote in message
news:11**********************@p79g2000cwp.googlegr oups.com...
> Can any one write me how to create a class which cannot be
> inherited by any other calls. Sumit Rajan wrote:
See:
http://www.parashift.com/c++-faq-lit...html#faq-23.11

Indraseena wrote:
Thankyou very much for your reflex reply.


red floyd <no*****@here.dude> wrote:
2. He did answer your question. He told you exactly where to find it,
and he followed the recommendations in the FAQ:
http://www.parashift.com/c++-faq-lit...t.html#faq-5.5

So don't get nasty about a "reflex" reply.


I didn't see his post as being nasty. Maybe he meant "reflex" to mean
quick and speedy.

--
Marcus Kwok
Replace 'invalid' with 'net' to reply


Jun 26 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: mshetty | last post by:
Hi, I get an error "Warning: b::a_method hides the virtual function a::a_method()." on compiling the following code.. #include <iostream.h> class a {
27
by: tuvok | last post by:
Is it correct that the virtual dtor of base gets called implicitly? Here's some code to demonstrate what I mean: Class B has a virtual destructor, so has class D which is derived from B. Deleting...
11
by: anongroupaccount | last post by:
What measures should be taken to avoid this sort of thing? class Base { }; class Derived1 : public Base { private: int i, j, k;
34
by: Asfand Yar Qazi | last post by:
Hi, I'm creating a library where several classes are intertwined rather tightly. I'm thinking of making them all use pimpls, so that these circular dependancies can be avoided easily, and I'm...
6
by: noel.hunt | last post by:
I have a base class, PadRcv, with virtual functions. User code will derive from this class and possibly supply it's own functions to override the base class virtual functions. How can I test that...
84
by: Peter Olcott | last post by:
Is there anyway of doing this besides making my own string from scratch? union AnyType { std::string String; double Number; };
7
by: BeautifulMind | last post by:
In case of inheritence the order of execution of constructors is in the order of derivation and order of destructor execution is in reverse order of derivation. Is this case also true in case...
15
by: Anthony Greene | last post by:
This is probably a very introductory object-oriented question, but it has been nagging me for years, and since I've never been able to find the right answer, I've had to work around it with...
6
by: reppisch | last post by:
Hi Ng, besides that this style may be asking for trouble i'm faced with a unexpected gcc behaviour. Tested with gcc 3.3.3. On M$ .Net this compiles just fine. I'm trying to make a non-const...
11
by: Rafe | last post by:
Hi, I'm working within an application (making a lot of wrappers), but the application is not case sensitive. For example, Typing obj.name, obj.Name, or even object.naMe is all fine (as far as...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.