Boost logo

Boost :

Subject: [boost] [config] [random] usage of BOOST_NO_MEMBER_TEMPLATE_FRIENDS
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2009-02-06 16:19:25


Boost.Random uses BOOST_NO_MEMBER_TEMPLATE_FRIENDS to decide
whether it is safe to define the stream operators.

  template<class CharT, class Traits>
  friend std::basic_ostream<CharT,Traits>&
  operator<<(std::basic_ostream<CharT,Traits>& os, const uniform_int& ud);

  template<class CharT, class Traits>
  friend std::basic_istream<CharT,Traits>&
  operator>>(std::basic_istream<CharT,Traits>& is, uniform_int& ud);

However, the documentation of BOOST_NO_MEMBER_TEMPLATE_FRIENDS
says that BOOST_NO_MEMBER_TEMPLATE_FRIENDS is defined if the compiler
doesn't support
    template<class P> friend class frd;

It seems from
that these do not correspond exactly.

Are there any compilers that we still care about,
that don't support this use of friend?

Also, it sounds to me like the use of
wrong because it is documented as "Compiler requires
inherited operator friend functions to be defined at namespace scope"
and there is no inheritance here. Is this right?

In Christ,
Steven Watanabe

Boost list run by bdawes at, gregod at, cpdaniel at, john at