Sponsored Content
Top Forums Programming About uncopyable class (on book:Effective C++) Post 302739537 by Corona688 on Tuesday 4th of December 2012 10:22:28 AM
Old 12-04-2012
It's not inconsistent, you get what you ask for, nothing more, nothing less.

Quote:
Originally Posted by Corona688
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.
Quote:
1) You have overloaded the Dog() constructor. This means you get to choose what you pass into Uncopyable().
Quote:
This means you get to choose what you pass into Uncopyable().
What did you pass into Uncopyable() there? Nothing -- absolutely nothing.

What did it pass into Uncopyable()? Nothing, absolutely nothing.

The default copy constructor isn't called by the Dog() class because you overloaded it. It does what you say, instead of the defaults. That's what overloading is for. If you want default behavior, either don't overload it, or call it yourself...
This User Gave Thanks to Corona688 For This Post:
 

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::MD5Digest(3)					     Library Functions Manual						 ost::MD5Digest(3)

NAME
ost::MD5Digest - A md5 collection/computation accululator class. SYNOPSIS
#include <digest.h> Inherits ost::Digest. Public Member Functions MD5Digest () void initDigest (void) unsigned getSize (void) unsigned getDigest (unsigned char *buffer) void putDigest (const unsigned char *buffer, unsigned len) Protected Member Functions int overflow (int c) void update (void) void commit (void) std::ostream & strDigest (std::ostream &os) Detailed Description A md5 collection/computation accululator class. Author: David Sugar dyfet@ostel.com md5 hash accumulation. Examples: digest.cpp. Constructor &; Destructor Documentation ost::MD5Digest::MD5Digest () Member Function Documentation void ost::MD5Digest::commit (void) [protected] unsigned ost::MD5Digest::getDigest (unsigned char *buffer) [virtual] Implements ost::Digest. unsigned ost::MD5Digest::getSize (void) [inline], [virtual] Implements ost::Digest. void ost::MD5Digest::initDigest (void) [virtual] Implements ost::Digest. int ost::MD5Digest::overflow (intc) [protected] void ost::MD5Digest::putDigest (const unsigned char *buffer, unsignedlen) [virtual] Implements ost::Digest. std::ostream& ost::MD5Digest::strDigest (std::ostream &os) [protected], [virtual] Implements ost::Digest. void ost::MD5Digest::update (void) [protected] Author Generated automatically by Doxygen for GNU CommonC++ from the source code. GNU CommonC++ Sat Jun 23 2012 ost::MD5Digest(3)
All times are GMT -4. The time now is 08:56 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy