Sponsored Content
Top Forums Programming About uncopyable class (on book:Effective C++) Post 302739137 by Corona688 on Monday 3rd of December 2012 03:14:32 PM
Old 12-03-2012
More precise than what? There is not a lot more information to be had.

1) You have overloaded the = operator.
2) You don't assign to that class using the = operator anywhere.
3) Therefore, the = operator is not called.

Next,

1) You have overloaded the Dog() constructor. This means you get to choose what you pass into Uncopyable().
2) You don't pass anything into Uncopyable().
3) Therefore nothing gets passed into Uncopyable(). It uses the default constructor.

It's not going to assume what things it shouldn't and shouldn't take from a custom constructor. If you wanted it to use the other constructor, you'd have to tell it, something like so:

Code:
Dog(const Dog &rhs):Uncopyable(rhs) {}


Last edited by Corona688; 12-03-2012 at 04:23 PM..
 

9 More Discussions You Might Find Interesting

1. Cybersecurity

Changing effective user

I would like to give execution rights for a script to one user. (that's the easy part...) When that user is running the script, I would like the effective user ID to be that of the file-owner. Is this possible? (6 Replies)
Discussion started by: hilmel
6 Replies

2. UNIX for Dummies Questions & Answers

most effective search ?

what's the most efficient and effective search for a file in a dir ? I see many guys use this # find - print or something as such ? and sometimes pipe it to something else ? Is there a better way of using "grep" in all of this ? thanks simon2000 (3 Replies)
Discussion started by: simon2000
3 Replies

3. UNIX for Dummies Questions & Answers

car class (not school class)

im just trying to have some fun and kill some time writing a c++ program that has a person type in a car make and model then gives them a year and a price. or something like that. i always have problems getting it goin but once the ball is rolling im usually pretty good. anyone wanna help me out? ... (1 Reply)
Discussion started by: rickym2626
1 Replies

4. Programming

C++ class definition with a member of the same class

Hi, i have a question about C++. Is it possible to declare a class with a member ot the same class? For example, a linked list or i want to convert this C code to C++ class (Elemento) typedef struct elemento { char name; char value; List<struct elemento> ltElementos; ... (7 Replies)
Discussion started by: pogdorica
7 Replies

5. UNIX for Dummies Questions & Answers

Real and Effective IDs

Can anyone explain me in details of Real and Effective IDs (6 Replies)
Discussion started by: kkalyan
6 Replies

6. Programming

static use for class inside the same class c++

Hi, I believe the next code is wrong: class Egg { Egg e; int i; Egg(int ii=0) : i(ii) {} }; because you would end up with an endless definition (memory allocation) of Egg objects, thus int i. Ok, so God Eckel proposes for a singleton: class Egg { static Egg e; int... (5 Replies)
Discussion started by: xavipoes
5 Replies

7. UNIX for Advanced & Expert Users

Get pointer for existing device class (struct class) in Linux kernel module

Hi all! I am trying to register a device in an existing device class, but I am having trouble getting the pointer to an existing class. I can create a class in a module, get the pointer to it and then use it to register the device with: *cl = class_create(THIS_MODULE, className);... (0 Replies)
Discussion started by: hdaniel@ualg.pt
0 Replies

8. Programming

Size of Derived class, upon virtual base class inheritance

I have the two class definition as follows. class A { public: int a; }; class B : virtual public A{ }; The size of class A is shown as 4, and size of class B is shown as 16. Why is this effect ?. (2 Replies)
Discussion started by: techmonk
2 Replies

9. Programming

C++ : Base class member function not accessible from derived class

Hello All, I am a learner in C++. I was testing my inheritance knowledge with following piece of code. #include <iostream> using namespace std; class base { public : void display() { cout << "In base display()" << endl; } void display(int k) {... (2 Replies)
Discussion started by: anand.shah
2 Replies
ost::IPV4Validator(3)					     Library Functions Manual					     ost::IPV4Validator(3)

NAME
ost::IPV4Validator - Classes derived from IPV4Address would require an specific validator to pass to the IPV4Address constructor. SYNOPSIS
#include <address.h> Inherited by ost::IPV4MulticastValidator. Public Member Functions IPV4Validator () Constructor. virtual ~IPV4Validator () keeps compilers happy. virtual void operator() (const in_addr address) const =0 Pure virtual application operator. Detailed Description Classes derived from IPV4Address would require an specific validator to pass to the IPV4Address constructor. This is a base class for classes of function objects used by such derived classes. Author: Federico Montesino p5087@quintero.fie.us.es Abstract base class for derived inet addresses validators. Constructor &; Destructor Documentation ost::IPV4Validator::IPV4Validator () [inline] Constructor. Does not deal with any state. virtual ost::IPV4Validator::~IPV4Validator () [inline], [virtual] keeps compilers happy. Member Function Documentation virtual void ost::IPV4Validator::operator() (const in_addraddress) const [pure virtual] Pure virtual application operator. Apply the validation algorithm specific to derived classes. Implemented in ost::IPV4MulticastValidator. Author Generated automatically by Doxygen for GNU CommonC++ from the source code. GNU CommonC++ Sat Jun 23 2012 ost::IPV4Validator(3)
All times are GMT -4. The time now is 02:04 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy