Topic: using sub-objects to initialize other sub-objects
Author: Peter <ExcessPhase@gmail.com>
Date: Wed, 21 Nov 2007 19:04:40 CST Raw View
On Oct 27, 9:05 pm, "terminator(jam)" <farid.mehr...@gmail.com> wrote:
> Is that legal ?
> I mean something like this:
>
> struct A{
> int a,b;
> A():
> a(5),
> b(2*a) //Is this standard?
> {
> std::cout<<a<<' '<<b<<std::endl;
> };
>
> };
it is legal and I consider it the higher art of C++ programming.
Consider a window showing a bitmap from a file.
The final window object may contain
* a subobject creating/destroying the operating system specific window
handle
* a subobject for opening/closing the file handle
* a subobject allocating/destroying a buffer
* another subobject for reading the file into a buffer
* another subobject for creating/destroying a operating system
specific bitmap handle from the buffer
* another to create/destroy an operating system specific handle which
allows copying the bitmap to the window
* another subobject which shows/hides the window
* another subobject which invalidates the window so that it must
refresh
Of couse the window object must contain an operating system specific
callback routine,
which is called to draw the window.
All these subobjects may report errors using exceptions.
I call such subobjects either resource wrappers -- if they wrap a C-
Style resource into a C++ class.
or I call them functional wrappers -- if they only perform an
operation in the constructor.
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html ]
Author: "terminator(jam)" <farid.mehrabi@gmail.com>
Date: Mon, 26 Nov 2007 11:38:40 CST Raw View
On Nov 5, 8:59 pm, Jerry Coffin <jcof...@taeus.com> wrote:
> In article <1193930297.889943.87...@19g2000hsx.googlegroups.com>,
> farid.mehr...@gmail.com says...
>
> [ ... ]
>
> > void foo(){
> > class bar barobj explicit;//syntax suggestion :just allocate
> > barobj
> > //barobj.some_member();/*compile error:object not constructed
> > yet*/
> > if (some_ocasion()){
> > barobj.bar(init_params1);/*syntax suggestion:context based
> > construction*/
> > //...
> > }else{
> > barobj.bar(init_params2);
> > //...
> > };
> > barobj.some_member();//ok: barobj is constructed in either case
> > };
>
> The placement form of the new operator allows something like this right
> now:
>
> char buffer[sizeof bar];
> bar *x;
>
> if (some_ocasion())
> x=new(buffer) bar(init_params1);
> else
> x=new(buffer) bar(init_params2);
>
> bar &barobj(*x);
>
> barobj.some_member();
>
> barobj.~bar();
>
> Note that when you do this, you need to explicitly destroy the object
> you created, something like: 'barobj.~bar()'.
>
> The primary limitation on this is that 'bar' might have alignment
> requirements that aren't met by an arbitrary array of char. There are
> some (ugly) ways to work around that, or one fairly simple one: allocate
> the memory dynamically instead of automatically, since the memory
> returned from dynamic allocation (new or malloc) is guaranteed to have
> alignment suitable for any type.
>
you are missing something.I want to put the object on stack(auto
storage).moreover the type of object is known ,just the construction
is delayed and that is what new cannot give for it must serve just
like malloc(no typeing on returned ptr) at allocation phase to let
us do placement later which is really bad practice.
regards,
FM.
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html ]
Author: jcoffin@taeus.com (Jerry Coffin)
Date: Thu, 1 Nov 2007 04:41:43 GMT Raw View
In article <7e-dnTMOkMeLq7ranZ2dnUVZ8rCdnZ2d@bt.com>,
francis.glassborow@btinternet.com says...
> Hyman Rosen wrote:
> > Francis Glassborow wrote:
> >>>> struct A{ int a,b;
> >> In the above code a and b are not defined by the line int a,b;
> > > That statement merely declares them.
> >
> > (I think I'm attributing this correctly. The post to which I'm
> > responding had very long lines and so I might be off a little.)
> >
> > Francis is wrong; that line does define a and b, not just declare
> > them. See 3.1/2 for the details and 3.1/3 for an example.
> >
>
> It seems you are correct though that actually makes it even harder to
> write about C++. I do not know why I have never noticed those paragraphs
> before. I have always described a class definition as a set of
> declarations of its members.
>
> I note that the same paragraph(s) also make int x a definition in:
>
> int foo(int x);
>
> even though foo is only declared. Or does it? It is not covered by any
> of the examples.
>
> Of course we also have the silliness that a typedef declares a name even
> though the term was derived from typedefinition.
>
> Oh well we live and learn.
I think you've raised a reasonable point. At first blush, part of this
might be dealt with by adding a clause that says a declaration is not a
definition if the declaration is part of a declaration that is itself
not a definition. That wouldn't change the situation originally being
discussed with the class/struct definition, but would at least "fix"
things with respect to the function declaration you've given above.
I think in reality, there's a more fundamental problem here: it's
difficult to define "definition" and "declaration" in a way that fits
with current usage, and still makes a lot of sense. From what I've seen,
the typical view is that a declaration just tells the compiler about an
identifier, but a definition creates an object -- but by that thinking,
a class/struct "definition" is really only a declaration. I don't think
there's a clean way out of this either. Just for one obvious point of
comparison, this part of the C standard seems to be even more complex
and (probably) poorly understood. Just for one example, I doubt that 10%
of C programmers could give an accurate description of a tentative
definition...
--
Later,
Jerry.
The universe is a figment of its own imagination.
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html ]
Author: "terminator(jam)" <farid.mehrabi@gmail.com>
Date: Thu, 1 Nov 2007 11:30:19 CST Raw View
On Nov 1, 7:41 am, jcof...@taeus.com (Jerry Coffin) wrote:
> In article <7e-dnTMOkMeLq7ranZ2dnUVZ8rCdn...@bt.com>,
> francis.glassbo...@btinternet.com says...
>
>
>
>
>
> > Hyman Rosen wrote:
> > > Francis Glassborow wrote:
> > >>>> struct A{ int a,b;
> > >> In the above code a and b are not defined by the line int a,b;
> > > > That statement merely declares them.
>
> > > (I think I'm attributing this correctly. The post to which I'm
> > > responding had very long lines and so I might be off a little.)
>
> > > Francis is wrong; that line does define a and b, not just declare
> > > them. See 3.1/2 for the details and 3.1/3 for an example.
>
> > It seems you are correct though that actually makes it even harder to
> > write about C++. I do not know why I have never noticed those paragraphs
> > before. I have always described a class definition as a set of
> > declarations of its members.
>
> > I note that the same paragraph(s) also make int x a definition in:
>
> > int foo(int x);
>
> > even though foo is only declared. Or does it? It is not covered by any
> > of the examples.
>
> > Of course we also have the silliness that a typedef declares a name even
> > though the term was derived from typedefinition.
>
> > Oh well we live and learn.
>
> I think you've raised a reasonable point. At first blush, part of this
> might be dealt with by adding a clause that says a declaration is not a
> definition if the declaration is part of a declaration that is itself
> not a definition. That wouldn't change the situation originally being
> discussed with the class/struct definition, but would at least "fix"
> things with respect to the function declaration you've given above.
>
> I think in reality, there's a more fundamental problem here: it's
> difficult to define "definition" and "declaration" in a way that fits
> with current usage, and still makes a lot of sense. From what I've seen,
> the typical view is that a declaration just tells the compiler about an
> identifier, but a definition creates an object -- but by that thinking,
> a class/struct "definition" is really only a declaration. I don't think
> there's a clean way out of this either. Just for one obvious point of
> comparison, this part of the C standard seems to be even more complex
> and (probably) poorly understood. Just for one example, I doubt that 10%
> of C programmers could give an accurate description of a tentative
> definition...
>
> --
> Later,
> Jerry.
>
> The universe is a figment of its own imagination.
>
> ---
Hi, this is the OP.
I think there has been a confusion between the meaning of definition
and construction of an object;that is currently we assume an object as
to be defined when it is constructed,but I can not accept that this is
rational.
IMHO an object is defined when it is allocated and allocation always
precedes construction which most of the time happens right after the
allocation.So I was thinking of an explicit way of separating these
two phases and facilitating context based construction of the object:
void foo(){
class bar barobj explicit;//syntax suggestion :just allocate
barobj
//barobj.some_member();/*compile error:object not constructed
yet*/
if (some_ocasion()){
barobj.bar(init_params1);/*syntax suggestion:context based
construction*/
//...
}else{
barobj.bar(init_params2);
//...
};
barobj.some_member();//ok: barobj is constructed in either case
};
regards,
FM.
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html ]
Author: Jerry Coffin <jcoffin@taeus.com>
Date: Mon, 5 Nov 2007 11:59:32 CST Raw View
In article <1193930297.889943.87230@19g2000hsx.googlegroups.com>,
farid.mehrabi@gmail.com says...
[ ... ]
> void foo(){
> class bar barobj explicit;//syntax suggestion :just allocate
> barobj
> //barobj.some_member();/*compile error:object not constructed
> yet*/
> if (some_ocasion()){
> barobj.bar(init_params1);/*syntax suggestion:context based
> construction*/
> //...
> }else{
> barobj.bar(init_params2);
> //...
> };
> barobj.some_member();//ok: barobj is constructed in either case
> };
The placement form of the new operator allows something like this right
now:
char buffer[sizeof bar];
bar *x;
if (some_ocasion())
x=new(buffer) bar(init_params1);
else
x=new(buffer) bar(init_params2);
bar &barobj(*x);
barobj.some_member();
barobj.~bar();
Note that when you do this, you need to explicitly destroy the object
you created, something like: 'barobj.~bar()'.
The primary limitation on this is that 'bar' might have alignment
requirements that aren't met by an arbitrary array of char. There are
some (ugly) ways to work around that, or one fairly simple one: allocate
the memory dynamically instead of automatically, since the memory
returned from dynamic allocation (new or malloc) is guaranteed to have
alignment suitable for any type.
--
Later,
Jerry.
The universe is a figment of its own imagination.
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html ]
Author: "terminator(jam)" <farid.mehrabi@gmail.com>
Date: Sat, 27 Oct 2007 23:05:38 CST Raw View
Is that legal ?
I mean something like this:
struct A{
int a,b;
A():
a(5),
b(2*a) //Is this standard?
{
std::cout<<a<<' '<<b<<std::endl;
};
};
regards,
FM.
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html ]
Author: James Dennett <jdennett@acm.org>
Date: Sun, 28 Oct 2007 09:55:18 CST Raw View
terminator(jam) wrote:
> Is that legal ?
> I mean something like this:
>
> struct A{
> int a,b;
> A():
> a(5),
> b(2*a) //Is this standard?
> {
> std::cout<<a<<' '<<b<<std::endl;
> };
> };
It's entirely legal; a is declared before b, so it is
initialized before b, and hence b gets 10 here.
Such code can be fragile (e.g., changing the declaration
order leads to UB), but as written it's well defined.
-- James
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html ]
Author: AlbertoBarbati@libero.it (Alberto Ganesh Barbati)
Date: Sun, 28 Oct 2007 21:29:17 GMT Raw View
terminator(jam) ha scritto:
> Is that legal ?
> I mean something like this:
>
> struct A{
> int a,b;
> A():
> a(5),
> b(2*a) //Is this standard?
> {
> std::cout<<a<<' '<<b<<std::endl;
> };
> };
>
Yes, it is legal. However, you've got to be extra careful, because the
initialization of sub-objects happens in the order of their declaration
rather than in the order of the ctor-initializers. That is, the
following snippet calls for UB:
struct A{
int b, a; // notice: order reversed here
A():
a(5),
b(2*a) // UB! b is initialized before a
{
std::cout<<a<<' '<<b<<std::endl;
};
};
HTH,
Ganesh
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html ]
Author: jcoffin@taeus.com (Jerry Coffin)
Date: Sun, 28 Oct 2007 21:29:40 GMT Raw View
In article <1193517981.909906.296120@d55g2000hsg.googlegroups.com>,
farid.mehrabi@gmail.com says...
> Is that legal ?
> I mean something like this:
>
> struct A{
> int a,b;
> A():
> a(5),
> b(2*a) //Is this standard?
It's allowed, but you do have to be careful. The members are initialized
in the order in which they're defined. In this case, you've followed the
order of definition, so it's fine. If you reversed things so it looked
something like:
A() : b(5), a(2*b) {}
Things would NOT be good at all. The members are still initialized in
the order of definition, so 'a' gets initialized first, using whatever
happened to be in 'b', then 'b' is initialized to the value 5.
Even though what you've done is allowed, many people advise against it.
--
Later,
Jerry.
The universe is a figment of its own imagination.
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html ]
Author: hyrosen@mail.com (Hyman Rosen)
Date: Sun, 28 Oct 2007 21:29:39 GMT Raw View
terminator(jam) wrote:
> Is that legal ?
> struct A { int a,b; A() : a(5), b(2*a) //Is this standard?
Yes, this is fine. The only thing (but an important one) is that
no matter how you write your initializer list, the members are
initialized in the order they're declared in the class. If you
had written 'A() : b(5), a(2*b)', a would still be initialized
first, with a garbage value.
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html ]
Author: =?iso-8859-1?q?Daniel_Kr=FCgler?= <daniel.kruegler@googlemail.com>
Date: Sun, 28 Oct 2007 16:32:22 CST Raw View
On 28 Okt., 06:05, "terminator(jam)" <farid.mehr...@gmail.com> wrote:
> Is that legal ?
> I mean something like this:
>
> struct A{
> int a,b;
> A():
> a(5),
> b(2*a) //Is this standard?
> {
> std::cout<<a<<' '<<b<<std::endl;
> };
>
> };
Yes this is "legal" and has defined behaviour (i.e.
A::b == 10 after the initialisation), because of [class.base.init]/5:
"Initialization shall proceed in the following order: [..]
- Then, nonstatic data members shall be initialized in the order
they were declared in the class definition (again regardless of the
order of the mem-initializers).[..]"
in combination with [class.base.init]/3:
"[..] There is a sequence point (1.9) after the initialization of
each
base and member. The expression-list of a mem-initializer is
evaluated
as part of the initialization of the corresponding base or member."
In your example A::a is declared *before* A::b and this guarantees
that it's initialization happens before that of A::b or vice-versa:
The
initialization of b can trust that a is completely initialized. The
above
quoted paragraph also provides similar guarantees for base-classes
of the corresponding class, which I have omitted here for clarity.
If you want to irritate the reader of your class, you also could
have written:
struct A{
int a,b;
A():
b(2*a),
a(5)
{
std::cout<<a<<' '<<b<<std::endl;
}
};
which has exactly the *same* effect as your original code
(but don't tell your colleagues that I recommended this!).
Greetings from Bremen,
Daniel Kr gler
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html ]
Author: "terminator(jam)" <farid.mehrabi@gmail.com>
Date: Mon, 29 Oct 2007 11:07:01 CST Raw View
On Oct 29, 1:32 am, Daniel Kr gler <daniel.krueg...@googlemail.com>
wrote:
> On 28 Okt., 06:05, "terminator(jam)" <farid.mehr...@gmail.com> wrote:
>
> > Is that legal ?
> > I mean something like this:
>
> > struct A{
> > int a,b;
> > A():
> > a(5),
> > b(2*a) //Is this standard?
> > {
> > std::cout<<a<<' '<<b<<std::endl;
> > };
>
> > };
>
> Yes this is "legal" and has defined behaviour (i.e.
> A::b == 10 after the initialisation), because of [class.base.init]/5:
>
> "Initialization shall proceed in the following order: [..]
> - Then, nonstatic data members shall be initialized in the order
> they were declared in the class definition (again regardless of the
> order of the mem-initializers).[..]"
>
> in combination with [class.base.init]/3:
>
> "[..] There is a sequence point (1.9) after the initialization of
> each
> base and member. The expression-list of a mem-initializer is
> evaluated
> as part of the initialization of the corresponding base or member."
>
> In your example A::a is declared *before* A::b and this guarantees
> that it's initialization happens before that of A::b or vice-versa:
> The
> initialization of b can trust that a is completely initialized. The
> above
> quoted paragraph also provides similar guarantees for base-classes
> of the corresponding class, which I have omitted here for clarity.
>
> If you want to irritate the reader of your class, you also could
> have written:
>
> struct A{
> int a,b;
> A():
> b(2*a),
> a(5)
> {
> std::cout<<a<<' '<<b<<std::endl;
> }
>
> };
>
> which has exactly the *same* effect as your original code
> (but don't tell your colleagues that I recommended this!).
>
> Greetings from Bremen,
>
> Daniel Kr gler
>
**A BIG THANK 4 EVERY 1**.
I do not reply each post individually ;my intention was something like
this:
class A{
const class B1 b1;
const class B2 b2;
//rest of members
public:
A(params):
b1(a_big_existing_funxn(params) ,
b2(another_funxn(b1,params)
{
//do the rest
};
};
thanks,
FM.
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html ]
Author: Francis Glassborow <francis.glassborow@btinternet.com>
Date: Mon, 29 Oct 2007 11:11:54 CST Raw View
Jerry Coffin wrote:
> In article <1193517981.909906.296120@d55g2000hsg.googlegroups.com>,
> farid.mehrabi@gmail.com says...
>> Is that legal ?
>> I mean something like this:
>>
>> struct A{
>> int a,b;
>> A():
>> a(5),
>> b(2*a) //Is this standard?
>
> It's allowed, but you do have to be careful. The members are initialized
> in the order in which they're defined. In this case, you've followed the
> order of definition, so it's fine. If you reversed things so it looked
> something like:As this is comp.std.c++let me be pedantic. In the above code a and b are
not defined by the line int a,b; That statement merely declares them.
--
Note that robinton.demon.co.uk addresses are no longer valid.
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html ]
Author: hyrosen@mail.com (Hyman Rosen)
Date: Mon, 29 Oct 2007 17:01:39 GMT Raw View
Francis Glassborow wrote:
>>> struct A{ int a,b;
> In the above code a and b are not defined by the line int a,b;
> That statement merely declares them.
(I think I'm attributing this correctly. The post to which I'm
responding had very long lines and so I might be off a little.)
Francis is wrong; that line does define a and b, not just declare
them. See 3.1/2 for the details and 3.1/3 for an example.
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html ]
Author: francis.glassborow@btinternet.com (Francis Glassborow)
Date: Tue, 30 Oct 2007 14:46:23 GMT Raw View
Hyman Rosen wrote:
> Francis Glassborow wrote:
>>>> struct A{ int a,b;
>> In the above code a and b are not defined by the line int a,b;
> > That statement merely declares them.
>
> (I think I'm attributing this correctly. The post to which I'm
> responding had very long lines and so I might be off a little.)
>
> Francis is wrong; that line does define a and b, not just declare
> them. See 3.1/2 for the details and 3.1/3 for an example.
>
It seems you are correct though that actually makes it even harder to
write about C++. I do not know why I have never noticed those paragraphs
before. I have always described a class definition as a set of
declarations of its members.
I note that the same paragraph(s) also make int x a definition in:
int foo(int x);
even though foo is only declared. Or does it? It is not covered by any
of the examples.
Of course we also have the silliness that a typedef declares a name even
though the term was derived from typedefinition.
Oh well we live and learn.
--
Note that robinton.demon.co.uk addresses are no longer valid.
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html ]
Author: jcoffin@taeus.com (Jerry Coffin)
Date: Tue, 30 Oct 2007 16:12:10 GMT Raw View
In article <sICdnZ0_C-IKbrjanZ2dneKdnZydnZ2d@bt.com>,
francis.glassborow@btinternet.com says...
> Jerry Coffin wrote:
> > In article <1193517981.909906.296120@d55g2000hsg.googlegroups.com>,
> > farid.mehrabi@gmail.com says...
> >> Is that legal ?
> >> I mean something like this:
> >>
> >> struct A{
> >> int a,b;
> >> A():
> >> a(5),
> >> b(2*a) //Is this standard?
> >
> > It's allowed, but you do have to be careful. The members are initialized
> > in the order in which they're defined. In this case, you've followed the
> > order of definition, so it's fine. If you reversed things so it looked
> > something like:
>
> As this is comp.std.c++let me be pedantic. In the above code a and b are
> not defined by the line int a,b; That statement merely declares them.
Here's an example from the standard (from [basic.def]):
struct S { int a; int b; }; // defines S, S::a, and S::b
If there's a relevant difference between this example and the code
above, I must have missed it. Being an example, this isn't a normative
part of the standard, but my reading of the normative language in
[basic.def] seems to indicate that these are definitions as well. The
text I'm going by is ([basic.def]/2):
A declaration is a definition unless it declares a
function without specifying the function?s body (8.4),
it contains the extern specifier (7.1.1) or a linkage-
specification) (7.5) and neither an initializer nor
a function-body, it declares a static data member in a
class declaration (9.4), it is a class name
declaration (9.1), or it is a typedef declaration
(7.1.3), a using-declaration (7.3.3), or a using-
directive (7.3.4).
At least as I read this, the example seems to be correct, and the
preceding code not only declares, but also defines, the variables 'a'
and 'b'.
--
Later,
Jerry.
The universe is a figment of its own imagination.
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html ]