From: Gokhan Kisacikoglu <kisa@centropolisfx.com>
To: bernd.speiser@uni-tuebingen.de
Cc: gcc-help@gcc.gnu.org
Subject: Re: friend operators
Date: Mon, 26 Aug 2002 10:47:00 -0000 [thread overview]
Message-ID: <3D6A6A4D.44296C48@centropolisfx.com> (raw)
In-Reply-To: <3D5BDF8D.2FBB3C04@uni-tuebingen.de>
> void operator<< (string &);
if you encapsulate it within a namespace, don't, it doesn't seem to
work, you should declare this operator globally for it to work, I've
seen this work with other compilers, but not with gcc...
Gokhan
>
> this does not work if the second operator<< is NOT a friend.
> Then I get the error message
>
> ../Quantity/Quantity.h: In instantiation of `Quantities::VariableQuantity<Units:
> :QuantityUnit<Quantities::LengthUnitClass>,Dimensions::QuantityDimension<Quantit
> ies::LengthDimensionClass> >':
> Length.h:431: instantiated from here
> ../Quantity/Quantity.h:852: invalid use of undefined type `class Quantities::Var
> iableQuantity<Units::QuantityUnit<Quantities::LengthUnitClass>,Dimensions::Quant
> ityDimension<Quantities::LengthDimensionClass> >'
> ../Quantity/Quantity.h:907: forward declaration of `class Quantities::VariableQu
> antity<Units::QuantityUnit<Quantities::LengthUnitClass>,Dimensions::QuantityDime
> nsion<Quantities::LengthDimensionClass> >'
> ../Quantity/Quantity.h:852: confused by earlier errors, bailing out
>
> when I try to instantiate the template (or, if this is not a template class, if
> I just want to use the class).
> If the second operator<< is also a friend, it compiles ok.
>
next prev parent reply other threads:[~2002-08-26 17:47 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-08-15 10:06 Bernd Speiser
2002-08-26 10:47 ` Gokhan Kisacikoglu [this message]
2002-08-27 6:43 ` Bernd Speiser
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3D6A6A4D.44296C48@centropolisfx.com \
--to=kisa@centropolisfx.com \
--cc=bernd.speiser@uni-tuebingen.de \
--cc=gcc-help@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).