D
DK
Is there any pointer analog to this code (adapted from the FAQ):
someclass Objects[5] = { someclass(1), someclass(2), someclass(3),
someclass(4), someclass(5) }; Also, does the above code require the
copy constructor and/or assignment operator to be public? Considering
the fact that someclass has only parameterized constructors (so
creating someclass *pObjects = new someclass[5]; is not an option)?
The idea behind this is that I want to create a class which is
immutable and non-copyable after construction. Hence I don't want to
make the copy constructor and operator = public.
someclass Objects[5] = { someclass(1), someclass(2), someclass(3),
someclass(4), someclass(5) }; Also, does the above code require the
copy constructor and/or assignment operator to be public? Considering
the fact that someclass has only parameterized constructors (so
creating someclass *pObjects = new someclass[5]; is not an option)?
The idea behind this is that I want to create a class which is
immutable and non-copyable after construction. Hence I don't want to
make the copy constructor and operator = public.