See the following code:
If I comment out that line, g++ will complaint "Uncopyable::Uncopyable(const Uncopyable&) is private". I think that mean the default copy ctor of derived class created by g++ called the base class' copy ctor.
If I make available of that line, every thing is ok. It out put
I think this mean the default copy ctor of derived class created by g++ called the base class' default ctor.
Am I right? If yes, why doesn't the default copy ctor derived class, in condition 2, call the base class' copy ctor? Why it behave so inconsistently?
thank you!
Last edited by vistastar; 12-01-2012 at 06:31 AM..
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)
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)
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)
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)
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)
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)
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)
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
LEARN ABOUT OSX
is
is(n) [incr Tcl] is(n)
__________________________________________________________________________________________________________________________________________________NAME
is - test argument to see if it is a class or an object
SYNOPSIS
itcl::is option ?arg arg ...?
_________________________________________________________________DESCRIPTION
The is command is used to check if the argument given is a class or an object; depending on the option given. If the argument if a class or
object, then 1 is returned. Otherwise, 0 is returned. The is command also recognizes the commands wrapped in the itcl code command.
The option argument determines what action is carried out by the command. The legal options (which may be abbreviated) are:
is class command
Returns 1 if command is a class, and returns 0 otherwise.
The fully qualified name of the class needs to be given as the command argument. So, if a class resides in a namespace, then the
namespace needs to be specified as well. So, if a class C resides in a namespace N, then the command should be called like:
is N::C
or
is ::N::C
is object ?-class className? command
Returns 1 if command is an object, and returns 0 otherwise.
If the optional "-class" parameter is specified, then the command will be checked within the context of the class given. Note that
className has to exist. If not, then an error will be given. So, if className is uncertain to be a class, then the programmer will
need to check it's existance beforehand, or wrap it in a catch statement.
So, if c is an object in the class C, in namespace N then these are the possibilities (all return 1):
set obj [N::C c]
itcl::is object N::c
itcl::is object c
itcl::is object $obj
itcl::is object [itcl::code c]
KEYWORDS
class, object
itcl 3.3 is(n)