Sponsored Content
Full Discussion: friend operator
Top Forums Programming friend operator Post 302204131 by asji on Tuesday 10th of June 2008 07:23:07 PM
Old 06-10-2008
I think you need to put the "friend" after the return value of the operator. I.e.:

ostream& friend operator<<(ostream& target, const PARA_DSC& para);

If "friend" is the first token, then it expects the declaration of a friend class.
 

3 More Discussions You Might Find Interesting

1. UNIX Desktop Questions & Answers

Find a friend

I am unix beginner, aspiration learning with unix. i want get help for unix .I have a dream that i become unix master-hand. I wish get your assist for unix or net. (2 Replies)
Discussion started by: Yeliu
2 Replies

2. UNIX for Dummies Questions & Answers

welcome YOUR NEW FRIEND RETO

Hello Every One Iam Your New Friend Reto .iam New In Unix Let Me Say That Iam Zero . And I Wish That You All Can Help Me With It By Your Help I Will Get To The Top Your New Friend Reto From Iraq Thank You All (0 Replies)
Discussion started by: retolop
0 Replies

3. Programming

What are Friend Functions in C++?

Hey C++ masters! I am a beginner in C++ and learning about it but have some doubts about Friend Functions. Anyone describe C++ Friend Functions? (1 Reply)
Discussion started by: ggiwebsinfo
1 Replies
index_set(7rheolef)						    rheolef-6.1 					       index_set(7rheolef)

NAME
index_set - a set of indexes (rheolef-6.1) SYNOPSYS
A class for: l = {1,3,...9} i.e. a wrapper for STL set<size_t> with some assignment operators, such as l1 += l2. This class is suitable for use with the array<T> class, as array<index_set> (see array(2)). IMPLEMENTATION
class index_set : public std::set<std::size_t> { public: // typedefs: typedef std::set<std::size_t> base; typedef std::size_t value_type; typedef std::size_t size_type; // allocators: index_set (); index_set (const index_set& x); index_set& operator= (const index_set& x); template <int N> index_set& operator= (size_type x[N]); void clear (); // basic algebra: void insert (size_type dis_i); // a := a union {dis_i} index_set& operator+= (size_type dis_i); // idem index_set& operator+= (const index_set& b); // a := a union b // a := a union b void inplace_union (const index_set& b); void inplace_intersection (const index_set& b); // c := a union b friend void set_union (const index_set& a, const index_set& b, index_set& c); friend void set_intersection (const index_set& a, const index_set& b, index_set& c); // io: friend std::istream& operator>> (std::istream& is, index_set& x); friend std::ostream& operator<< (std::ostream& os, const index_set& x); // boost mpi: template <class Archive> void serialize (Archive& ar, const unsigned int version); }; SEE ALSO
array(2) rheolef-6.1 rheolef-6.1 index_set(7rheolef)
All times are GMT -4. The time now is 08:10 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy